I have the following I wrote: how can I change the value of the checboxgroup? I need it to get wither both checboxes, none or one of them. I'm trying to do it with the change listener and setValue functions but it doesn't work. Can anyone understand how to do it?
{
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
}
]
}
Aucun commentaire:
Enregistrer un commentaire