var group = Ext.getCmp('myCheckboxGroup'); //取到对象
var checkbox = new Ext.form.Checkbox({boxLabel: 'Item 6', name: 'cb-cust-5'});
//group.items.getCount()是checkbox个数; group.panel.items.getCount()是列数;
var col = group.panel.items.get(group.items.getCount() % group.panel.items.getCount());
col = group.panel.items.get(0); //添加到第一列;
group.items.add(checkbox);
col.add(checkbox);
group.panel.doLayout();

本文介绍如何使用ExtJS框架动态地向Checkbox组中添加新的Checkbox元素,并详细解释了涉及的相关方法,如获取Checkbox组对象、创建新的Checkbox、确定插入位置及更新布局等。

457

被折叠的 条评论
为什么被折叠?



