Я написал следующее:
{
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
, но это не работает.
Кто-нибудь может понять, как это сделать?