/**添加&修改时--获取机柜号**/ function BindSelectJgh(jiguiColumnIdD, jiguiNumberIdD) { var jid = !jiguiColumnIdD ? $('#jiguiColumnId').val() : jiguiColumnIdD; var jgh = $('#jiguiNumberId'); jgh.find("option").remove(); jgh.append("<option value=''> --请选择--</option>"); jgh.val(null); jgh.trigger('change.select2'); $.ajax({ type : "post", url : '<c:url value="getJiguiJiguiNumber.do"/>', dataType : "json", data : { 'jiguiNumber.jiguiColumn.id' : jid }, success : function(data) { if (data.success == true) { $.each(data.rows, function(i, item) { jgh.append("<option value='" + item.id + "'> " + item.name + "</option>"); }); if (jiguiNumberIdD) { jgh.val(jiguiNumberIdD); jgh.trigger('change.select2'); } } else { errorbox(data.msg); } } }); }