标签:break easyui txt text 加载 combobox struct url hidden
这种代码看起来,也是让人醉醉的了~~~
$(‘#comboTestUnit‘).combobox({ valueField: ‘UnitId‘, textField: ‘UnitName‘, url: ‘/Bridge/getBridgeUnitList?BridgeId=‘ + bridgeId, onLoadSuccess: function (data) { if ($(‘#hiddenBridgeId‘).val()) { //根据隐藏id判断是新增还是编辑 for (var i = 0; i < data.length; i++) { if (data[i].UnitIsImportant == 1) { $("#comboTestUnit").combobox(‘select‘, data[i].UnitId); $(‘#comboStructureStyle‘).combobox(‘setValue‘, data[i].UnitIsImportant == 1 ? data[i].StructureStyle : ‘‘); $(‘#comboUnitIsImportant‘).combobox(‘setValue‘, data[i].UnitIsImportant == 1 ? data[i].UnitIsImportant : ‘0‘); $(‘#txtSpanRange‘).textbox(‘setValue‘, data[i].UnitIsImportant == 1 ? data[i].SpanNum : ‘0‘); break; } } } else { $(‘#comboTestUnit‘).combobox({ valueField: ‘UnitId‘, textField: ‘UnitName‘, url: ‘/Bridge/getBridgeUnitList?BridgeId=‘,//新增时需要清空下列列表中的值 onLoadSuccess: function (data) { } }); } } })
easyui的combobox中onLoadSuccess多次加载产生的问题
标签:break easyui txt text 加载 combobox struct url hidden
原文地址:https://www.cnblogs.com/yangwujun/p/9150629.html