打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Extjs 的 checkbox全选和反选
Java代码
Ext.create('Ext.form.Panel', {
title: 'Checkbox Group',
width: 300,
height: 125,
bodyPadding: 10,
renderTo: Ext.getBody(),
items:[{
xtype: 'checkboxgroup',
fieldLabel: 'Two Columns',
id:'cg',
// Arrange radio buttons into two columns, distributed vertically
columns: 2,
vertical: true,
items: [
{ boxLabel: 'Item 1', name: 'rb', inputValue: '1' },
{ boxLabel: 'Item 2', name: 'rb', inputValue: '2', checked: true },
{ boxLabel: 'Item 3', name: 'rb', inputValue: '3' },
{ boxLabel: 'Item 4', name: 'rb', inputValue: '4' },
{ boxLabel: 'Item 5', name: 'rb', inputValue: '5' },
{ boxLabel: 'Item 6', name: 'rb', inputValue: '6' }
]
}]
,bbar: [
{
text: '反选',
handler: function() {
var array = Ext.getCmp('cg').items;
array.each(function(item){
//                          alert(item.getValue());
if(item.getValue()==true){
item.setValue(false);
}else{
item.setValue(true);
}
});
//                      alert(Ext.getCmp('cg').items.length);
}
},
'-',
{
text: '全选',
handler: function() {
var array = Ext.getCmp('cg').items;
array.each(function(item){
item.setValue(true);
});
}
}
]
});
只要对checkboxgrounp进行遍历就可以
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
checkbox (Group)
javascript – 如何过滤ExtJs GridPanel / ExtJs商店?
ext checkBoxGroup获取选中项值
extjs---form表单基础1
EXT表单组件常见属性介绍(三)
无废话ExtJs[单选组:RadioGroup、复选组:CheckBoxGroup]
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服