George Sendrea
George Sendrea

Reputation: 31

How to get selected row values of extjs grid

Hello how can i get values from this object enter image description here and push them into an empty array this is the code. I don't want to use path may be there is there a function to get them or another code Thx

var selectedRowIndexes = [];
        // returns an array of selected records
        var selectedBanners = grid.getSelectionModel().getSelection(); 
        console.log(selectedBanners);
        Ext.iterate(selectedBanners, function(banner, data) {
            // push the row indexes into your array
        selectedRowIndexes.push(grid.getStore().indexOf(banner)); 
        });

Upvotes: 0

Views: 5270

Answers (1)

Evan Trimboli
Evan Trimboli

Reputation: 30092

getSelection gives you an array of selected records.

For each record, you can extract a field using:

record.get('theField');

Upvotes: 7

Related Questions