简体   繁体   English

Ext js获取选定的组记录

[英]Ext js get selected group records

I use a groupping feature on my grid. 我在网格上使用了灌浆功能。 How can I get all the records belonging to a single group when clicking on the group. 单击该组时,如何获取属于单个组的所有记录。 I have searched the docs but haven't found anything useful.. 我搜索了文档,但没有找到任何有用的东西..

PLease help 请帮忙

Ext.data.Store implement getGroups( [groupName] ) method. Ext.data.Store实现了getGroups( [groupName] )方法。 This method returns an array containing the result of applying grouping to the records in this store. 此方法返回一个数组,其中包含将分组应用于此存储中的记录的结果。 If you pass in an optional groupName argument it will returns information about specific group. 如果传入可选的groupName参数,它将返回有关特定组的信息。

In your listener for grid's groupclick event you can get records which belongs to group like this: 在grid的groupclick事件的监听器中,您可以获得属于这样的组的记录:

listeners: {
    groupclick: function (view, node, group, e, eOpts) {

        // get array of records which belongs to clicked group
        var recordsInGroup = view.getStore().getGroups(group).children;
    }
}

Fiddle with example: https://fiddle.sencha.com/#fiddle/391 举例说明: https//fiddle.sencha.com/#fiddle/391

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

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