ext checkboxgroup怎样动态生成
1个回答
展开全部
Ext.Ajax.request({
url: 'jsp/insurance/ins_liquidation/data/getPersonInsType.jsp',
params : {'employeeId':employeeId},
success: function(response, opts) {
var res = Ext.util.JSON.decode(response.responseText).root;
var resLen = res.length;
var items=[];
for(var i=0;i<res.length;i++)
{
var d=res[i];
var chk = {boxLabel: d.insName, name: d.insTypesId, inputValue:d.insTypesId,checked:true};
items.push(chk);
}
//定义多选组
var CheckBoxGroupTypes = new Ext.form.CheckboxGroup(
{
xtype: 'checkboxgroup',
fieldLabel: '申请清算险种',
id:'insTypeCb',
name :'insTypeCb',
columns: resLen,
anchor:"95%",
msgTarget:"side",
width:400
});
CheckBoxGroupTypes.items = items;
var cbp = Ext.getCmp('checkBoxPanel');
cbp.add(CheckBoxGroupTypes);
cbp.doLayout();
},
failure: function(response, opts) {
}
});
url: 'jsp/insurance/ins_liquidation/data/getPersonInsType.jsp',
params : {'employeeId':employeeId},
success: function(response, opts) {
var res = Ext.util.JSON.decode(response.responseText).root;
var resLen = res.length;
var items=[];
for(var i=0;i<res.length;i++)
{
var d=res[i];
var chk = {boxLabel: d.insName, name: d.insTypesId, inputValue:d.insTypesId,checked:true};
items.push(chk);
}
//定义多选组
var CheckBoxGroupTypes = new Ext.form.CheckboxGroup(
{
xtype: 'checkboxgroup',
fieldLabel: '申请清算险种',
id:'insTypeCb',
name :'insTypeCb',
columns: resLen,
anchor:"95%",
msgTarget:"side",
width:400
});
CheckBoxGroupTypes.items = items;
var cbp = Ext.getCmp('checkBoxPanel');
cbp.add(CheckBoxGroupTypes);
cbp.doLayout();
},
failure: function(response, opts) {
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询