Extjs4 Extjs 4.x-CheckboxModel以获取选中和未选中的值
我在网格面板中使用了复选框模型。当我选中复选框时,我是选中的列值。现在我需要的是,当我取消选中时,我需要得到相同的未选中值Extjs4 Extjs 4.x-CheckboxModel以获取选中和未选中的值,extjs4,selectionmodel,Extjs4,Selectionmodel,我在网格面板中使用了复选框模型。当我选中复选框时,我是选中的列值。现在我需要的是,当我取消选中时,我需要得到相同的未选中值 var selModel = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true, listeners: { selectionchange: function(model, records) { if (records[0]) {
var selModel = Ext.create('Ext.selection.CheckboxModel', {
checkOnly: true,
listeners: {
selectionchange: function(model, records) {
if (records[0]) {
id = records[0].get('id');
alert(id);
}
}
}
});
提前谢谢
问候,
里亚兹这是答案:
var selModel = Ext.create('Ext.selection.CheckboxModel', {
checkOnly: true,
listeners: {
deselect: function(model, record, index) {
id = record.get('id');
alert(id);
},
select: function(model, record, index) {
id = record.get('id');
alert(id);
}
}
})