Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Grid Grouping Bug

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-10027 in 4.2.2.1144.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2012
    Location
    Cornelio Procopio, PR, Brazil
    Posts
    8
    Vote Rating
    2
      2  

    Default Grid Grouping Bug

    There's a bug when using a grouping grid and you collapse a group: the rows of the next groups can't be selected. To see this bug, run the following example, collapse the first group and try to select the rows of the 2nd or 3rd group. I've tested it with ExtJs 4.2.1 GA.

    Code:
    <html>
    <head><title>Grid Grouping Bug</title></head>
    <body>
        <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
        <script type="text/javascript" src="../../ext-all.js"></script>
        <script type="text/javascript">
        Ext.onReady(function(){
            var myStore = Ext.create('Ext.data.ArrayStore',{
                pageSize:0,
                remoteSort:true,
                autoLoad:true,
                groupField:'Type',
                fields:['Id','Name','Type'],
                data:[
                    [1,'User 1','Type 1'],
                    [2,'User 2','Type 1'],
                    [3,'User 3','Type 1'],
                    [4,'User 4','Type 1'],
                    [5,'User 5','Type 2'],
                    [6,'User 6','Type 2'],
                    [7,'User 7','Type 2'],
                    [8,'User 8','Type 2'],
                    [9,'User 9','Type 3'],
                    [10,'User 10','Type 3'],
                    [11,'User 11','Type 3'],
                    [12,'User 12','Type 3'],
                    [13,'User 13','Type 4'],
                    [14,'User 14','Type 4'],
                    [15,'User 15','Type 4'],
                    [16,'User 16','Type 4'],
                    [17,'User 17','Type 5'],
                    [18,'User 18','Type 5'],
                    [19,'User 19','Type 5'],
                    [20,'User 20','Type 5']
                ]
            });
            var grid = Ext.create('Ext.grid.Panel',{
                title: 'Grid Grouping Bug',
                features: [{ftype:'grouping'}],
                store: myStore,
                renderTo: Ext.getBody(),
                columns:[
                    {text:'Id',dataIndex:'Id',width:200},
                    {text:'Name',dataIndex:'Name',flex:1,width:300},
                    {text:'Type',dataIndex:'Type',width:200}
                ]
            });
        });
        </script>
    </body>
    </html>
    To run this example just update the css and ext-all.js location. The path is right if you use this file in the grid examples folder.

    Thank you,
    Diogo Arenhart Marinho.

    *EDIT BY SLEMMON
    Issue observed in 4.2.1. Tested OK in 4.2.0.
    Using the instructions above, what you'll see is that the row selected is three above what was clicked.
    Last edited by slemmon; 31 May 2013 at 10:01 AM. Reason: Additional test notes

  2. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Vote Rating
    253
      -1  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha User Nom4d3's Avatar
    Join Date
    Sep 2008
    Location
    Araras / SP / Brazil
    Posts
    85
    Vote Rating
    3
      0  

    Default

    Someone have a patch for this issue? I have the same problem after upgrade from 4.2.0 to 4.2.1

    The action columns are returning the wrong record.

    I have to disable all the grid grouping from my application until I could find a fix for this. One of my action is sending email with some notifications. And these notifications were going to the wrong people

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2012
    Location
    Cornelio Procopio, PR, Brazil
    Posts
    8
    Vote Rating
    2
      0  

    Default

    I don't have any workaround. Someone does?
    My grids with grouping feature are still with this selection bug.

  5. #5
    Sencha User
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    149
    Vote Rating
    1
      0  

    Default

    +1 on this bug. Now records can't be selected on click at all after collapsing a group.

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    12
    Vote Rating
    6
      6  

    Default

    This patch is working well for me. It looks like the 'data-recordIndex' attribute is no longer skipping unrendered records in collapsed groups i.e. not matching original store indexes. However the 'data-recordId' attribute always appears to be correct.

    Code:
    Ext.define('App.overrides.view.Table', {
        override: 'Ext.view.Table',
    
    
        getRecord: function (node) {
            node = this.getNode(node);
            if (node) {
                //var recordIndex = node.getAttribute('data-recordIndex');
                //if (recordIndex) {
                //    recordIndex = parseInt(recordIndex, 10);
                //    if (recordIndex > -1) {
                //        // The index is the index in the original Store, not in a GroupStore
                //        // The Grouping Feature increments the index to skip over unrendered records in collapsed groups
                //        return this.store.data.getAt(recordIndex);
                //    }
                //}
                return this.dataSource.data.get(node.getAttribute('data-recordId'));
            }
        },
    
    
        indexInStore: function (node) {
            node = this.getNode(node, true);
            if (!node && node !== 0) {
                return -1;
            }
            //var recordIndex = node.getAttribute('data-recordIndex');
            //if (recordIndex) {
            //    return parseInt(recordIndex, 10);
            //}
            return this.dataSource.indexOf(this.getRecord(node));
        }
    });

  7. #7
    Sencha Premium Member
    Join Date
    Oct 2012
    Location
    Cornelio Procopio, PR, Brazil
    Posts
    8
    Vote Rating
    2
      0  

    Default

    It's working michael...
    Thanks you!!

  8. #8
    Sencha User Nom4d3's Avatar
    Join Date
    Sep 2008
    Location
    Araras / SP / Brazil
    Posts
    85
    Vote Rating
    3
      0  

    Default

    @michael.johnson

    It's working like a charm. Thanks for that!

  9. #9
    Sencha Premium Member
    Join Date
    Feb 2013
    Posts
    12
    Vote Rating
    6
      0  

    Default

    You're welcome.

  10. #10

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •