简体   繁体   中英

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

getSelection gives you an array of selected records.

For each record, you can extract a field using:

record.get('theField');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM