【发布时间】:2019-01-08 19:58:45
【问题描述】:
我写了以下内容:
{
xtype: "checkboxgroup",
fieldLabel: "Content type",
name: "content_type",
id: "fx-form-content_type",
rows: 1,
value: 0,
editable: false,
forceSelection: true,
queryMode: "local",
horizontal: true,
hidden: false,
listeners: {
change: function(cmp, value) {
//console.error(cmp.down("checkbox[inputValue=1]"));
//console.error(cmp.down("checkbox[inputValue=0]"));
//var vod_or_npvr = value["content_type_vod_or_npvr"];
console.error(cmp);
console.error(value);
/*
if(vod_or_npvr === 0)
{
Ext.getCmp("fx-form-content_type").setValue(2);
}
else if(vod_or_npvr === 1)
{
Ext.getCmp("fx-form-content_type").setValue(1);
}
else if(vod_or_npvr === [1,0])
{
Ext.getCmp("fx-form-content_type").setValue(0);
}
else {
Ext.getCmp("fx-form-content_type").setValue(3);
}*/
}
},
items: [{
xtype: "checkboxfield",
fieldLabel: "VOD",
checked: false,
//name : "content_type_vod_or_npvr",
inputValue: 1,
id: "fx-form-content_type-VOD",
value: 1,
labelWidth: 40
}, {
xtype: "checkboxfield",
fieldLabel: "NPVR",
checked: false,
//name : "content_type_vod_or_npvr",
inputValue: 0,
id: "fx-form-content_type-NPVR",
value: 2,
labelWidth: 40
}]
}
如何更改checboxgroup 的值?
我需要它来让checboxes 两个都枯萎,一个都不枯萎,或者其中一个枯萎。我正在尝试使用更改侦听器和setValue 函数来做到这一点,但它不起作用。
谁能明白怎么做?
【问题讨论】:
标签: javascript checkbox extjs