开发者

Extjs 4.x - CheckboxModel to get checked and unchecked value

开发者 https://www.devze.com 2023-03-20 06:41 出处:网络
I have used check box model in the grid panel. When i checke开发者_运维问答d the check box i am the checked column value. Now what i need is when i unchecked i need to get that same unchecked value.

I have used check box model in the grid panel. When i checke开发者_运维问答d the check box i am the checked column value. Now what i need is when i unchecked i need to get that same unchecked value.

var selModel = Ext.create('Ext.selection.CheckboxModel', {
    checkOnly: true,
    listeners: {
        selectionchange: function(model, records) {
            if (records[0]) {
                id = records[0].get('id');
                alert(id);
            }
        }
    }
});

Thanks in advance.

Regards,

Riyaz


This is the answer:

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);
        }
    }
})
0

精彩评论

暂无评论...
验证码 换一张
取 消