简体   繁体   English

如何获取extjs网格的选定行值

[英]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 我不想使用路径可能有一个函数可以获取它们或另一个代码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. getSelection为您提供了一组选定的记录。

For each record, you can extract a field using: 对于每条记录,您可以使用以下方法提取字段:

record.get('theField');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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