日期:2014-05-16 浏览次数:20475 次
function loadColumnPanel(combox) {
jQuery.ajax({
type : 'post',
url : workPath + '/target/doTargetGroup.do?method=loadColumnPanel',
dataType : 'json',
async : false,
data : "id=" + combox.value,
success : function(data) {
var d = data.datas;
if (d != null && d != undefined && d != "") {
/* 主要的代码开始 */
var columnBox = Ext.getCmp("columnBox");
var columns = columnBox.columns.length;
var items = columnBox.items;
var length = items.getCount();
for ( var i = 0; i < length; i++) {
var delItems = columnBox.items.items[0];
delItems.destroy();
columnBox.items.remove(delItems);
}
var col = columnBox.panel.items.get(0);
for ( var i = 0; i < d.length; i++) {
var chk = new Ext.form.Checkbox(d[i]);
col = columnBox.panel.items.get(i % columns);
col.add(chk);
columnBox.items.add(chk);
}
columnBox.panel.doLayout();
/* 主要的代码结束 */
}
}
});
}
?
更新前:
?
更新后:点选combox更新所有checkbox
