You found a bug! We've classified it as EXTJS-11008 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2013
    Location
    Toronto, Canada
    Posts
    47
    Vote Rating
    2
    Baidaly is on a distinguished road

      0  

    Default Issue with Store Filter and Grouping feature disabling

    Issue with Store Filter and Grouping feature disabling


    REQUIRED INFORMATION

    Ext version tested:
    • Ext 4.2.1.883


    Browser versions tested against:
    • Chrome 28.0.1500.95 m
    • FF23.0


    Description:
    • Issue with Store Filter and Grouping feature disabling


    Steps to reproduce the problem:
    • Create the Grid
    • Add Grouping feature, collapsed initially (startCollapsed: true)
    • Disable Grouping Feature (Click on 'Remove Grouping' button)
    • Filter the Grid's Store using filterBy (Click on 'Filter' button)


    The result that was expected:
    • Values in the Grid filtered by filterBy
    • But if do filtration before grouping disabling it works as expected

    The result that occurs instead:
    • GridPanel shows one empty row


    Test Case:

    Code:
    var filterGridGroup = function (filterBy, value) {
        if (value == "") {
            group1.startCollapsed = true;
            myStore.clearFilter();
            return;
        }
    
        group1.startCollapsed = true;
        store = myStore;
        store.clearFilter();
    
        if (value != "") {
            store.filterBy(function (record) {
                flag = false;
                Ext.each(value, function (val) {
                    if
                        (record.data[filterBy].toString().toLowerCase().indexOf(val.toString().toLowerCase()) != -1) {
                        flag = true;
                    }
                });
                if (flag)
                    return true;
            });
        }
    };
    
    Ext.onReady(function(){
        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']
            ]
        });
        
        group1 = Ext.create("Ext.grid.feature.GroupingSummary",{
          "ftype": "groupingsummary",
          "groupHeaderTpl": "{Type}",
          "startCollapsed": true
        });
        
        myGrid = Ext.create('Ext.grid.Panel',{
            title: 'Grid Grouping Bug',
            id: 'MyGrid',
            features: [group1],
            store: myStore,
            renderTo: Ext.getBody(),
            tbar: [{
                xtype: 'toolbar',
                items: [{
                    text: 'Remove Groping',
                    handler: function() { group1.disable(); }
                }, {
                    text: 'Filter',
                    handler: function() { filterGridGroup('Id', '1'); }
                }]
            }],
            columns:[
                {text:'Id',dataIndex:'Id',width:200},
                {text:'Name',dataIndex:'Name',flex:1,width:300},
                {text:'Type',dataIndex:'Type',width:200}
            ]
        });
    });

    HELPFUL INFORMATION

    Screenshot or Video:
    2.jpg
    After disabling and filtration

    1.jpg
    Without disabling

    Possible fix:
    • Not found


    Additional CSS used:
    • only default ext-all.css


    Operating System:
    • Win7 Pro
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    3,598
    Vote Rating
    68
    Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough

      0  

    Default


    Not sure this is a bug. In line 8 of your test case, you are setting startCollapsed=true on the disabled group. When I remove that line, your code seems to function as you expect.

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Location
    Toronto, Canada
    Posts
    47
    Vote Rating
    2
    Baidaly is on a distinguished road

      0  

    Default


    Thank you for your response.

    Yes, we know that it works well when we remove startCollapsed="true" but we need to show them initially collapsed.
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha User
    Join Date
    Mar 2013
    Location
    Toronto, Canada
    Posts
    47
    Vote Rating
    2
    Baidaly is on a distinguished road

      0  

    Default


    Bump...
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  5. #5
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    974
    Vote Rating
    110
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Quote Originally Posted by Gary Schlosberg View Post
    Not sure this is a bug. In line 8 of your test case, you are setting startCollapsed=true on the disabled group. When I remove that line, your code seems to function as you expect.
    Yes, that appears to be the issue. Setting up startCollapsed to true on a disabled Grouping feature somehow affects on rendering. We think it should not. Probably, a Grouping's disable method doesn't do its job well. What do you think, Gary?
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  6. #6
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    3,598
    Vote Rating
    68
    Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough Gary Schlosberg is a jewel in the rough

      0  

    Default


    Sorry for the delay, and thanks for the report! I have opened a bug in our bug tracker.