jquery动态添加select2
2019-09-25 本文已影响0人
左木北鱼
<select name="participant[]" class="form-control input-medium" required >
<option value="">请选择项目参与人</option>
<volist name="data['department_user']" id="vo">
<optgroup label="<{$vo.dept_name}>">
<volist name="vo['sys_user']" id="user">
<option value="<{$user['id']}>" ><{$user['realname']}></option>
</volist>
</optgroup>
</volist>
</select>
$('.participant-list').append(participantContent).find('select').select2({
selectOnClose: true
})