extjs 初始化checkboxgroup值的代码
(编辑:jimmy 日期: 2025/5/12 浏览:3 次 )
复制代码 代码如下:
Ext.override(Ext.form.CheckboxGroup,{
setValueForItem : function(val){ //多个选项值以逗号分开的
val = ","+val+","
this.items.each(function(item) {
if (val.indexOf(item.inputValue) > -1) {
item.setValue(true);
} else {
item.setValue(false);
}
});
}
,clearValueForItem:function(){ // 清空所有值
this.items.each(function(item) {
item.setValue(false);
});
}
});
Ext.override(Ext.form.CheckboxGroup,{
setValueForItem : function(val){ //多个选项值以逗号分开的
val = ","+val+","
this.items.each(function(item) {
if (val.indexOf(item.inputValue) > -1) {
item.setValue(true);
} else {
item.setValue(false);
}
});
}
,clearValueForItem:function(){ // 清空所有值
this.items.each(function(item) {
item.setValue(false);
});
}
});
下一篇:基于jquery的一个拖拽到指定区域内的效果