<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">
模具编号
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="select2_group form-control" id="mouldCode" name="mouldCode">
</select>
</div>
</div>
function getMouldList() {
$.ajax({
type: 'POST',
url: '/mouldInfo/listAllMouldCode',
success: function(data) {
var code3;
for (var a=0;a<data.length;a++) {
var dataContent = data[a];
if (dataContent == mouldCode) {
code3 = code3 + '<option selected="selected">' + data[a] + '</option>'
}
if (dataContent != mouldCode) {
code3 = code3 + '<option>' + data[a] + '</option>'
}
}
$('#mouldCode').empty().append(code3);
}
});
}
$(document).ready(function(){
$(".select2_single").select2({
placeholder: "Select a state",
allowClear: true
});
$(".select2_group").select2({});
$(".select2_multiple").select2({
maximumSelectionLength: 4,
placeholder: "With Max Selection limit 4",
allowClear: true
});
getMouldList();
});