lamer lamer
lamer lamer

Reputation: 345

CheckboxModel to get checked All value in extjs

I have used check box model in the grid panel and it can Checked All. i have got the value when it is checked or unchecked selected column. like this

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

but how to get value when I click checked all?

Upvotes: 0

Views: 1474

Answers (1)

CD..
CD..

Reputation: 74166

Use the selectionchange event:

Fired after a selection change has occurred

Parameters:

this: Ext.selection.Model
selected: Ext.data.Model[] The selected records
eOpts: Object The options object passed to Ext.util.Observable.addListener.

Alternatively you can use the getSelection() method in your select event:

Returns an array of the currently selected records.

Upvotes: 1

Related Questions