Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Store autoLoad=false is ignored if remoteFilter is true and there are filters in Grid

    You found a bug! We've classified it as EXTJS-23693 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    220

    Default Store autoLoad=false is ignored if remoteFilter is true and there are filters in Grid

    Ext version tested:
    • Ext 6.0.1 rev 250

    Description:
    • Store autoLoad=false is ignored (and data IS auto-loaded) if
    • you create a Grid with the gridfilters plugin
    • at least a Column has a filter configured on it (also if without default value)
    • remoteFilter is true

    Steps to reproduce the problem:
    • Create a JsonStore with "autoLoad: false" and "remoteFilter: true"
    • Create a Grid using the previous Store
    • Add "plugins: 'gridfilters'" to the Grid
    • Add "filter: { type: 'string' }" to at least a column

    The result that was expected:
    • The Store is NOT auto-loaded

    The result that occurs instead:
    • The Store IS auto-loaded


  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962

    Default

    Thanks for the report, I've added this to our bug tracking system.


    Regards,
    Bryan

  3. #3
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    220

    Default

    Thank you Bryan.

    In the meanwhile I found a possible workaround:
    Code:
    Ext.define('MyApp.patch.data.AbstractStore', {
        override: 'Ext.data.AbstractStore',
    
        // Skip first load caused by filters initialization if autoLoad=false and Store has never been loaded
        onFilterEndUpdate: function () {
            var me = this,
                mustSkipLoad = !me.getAutoLoad() && !me.isLoaded(),
                originalSuppressNext = me.suppressNextFilter;
    
            if (mustSkipLoad) {
                me.suppressNextFilter = true;
                me.callParent(arguments);
                me.suppressNextFilter = originalSuppressNext;
            } else {
                me.callParent(arguments);
            }
        }
    });

  4. #4
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    220

    Default

    It is very similar to this other bug:
    EXTJS-19781
    remoteSort trigger an autoLoad ? (ExtJS 6.0.1)
    https://www.sencha.com/forum/showthr...-(ExtJS-6.0.1)

  5. #5
    Sencha Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    658

    Default

    This is a problem in 6.0.2 - but I did not have the issue in 6.0.1

    Edit: Sorry.. I did have the issue on 6.0.1 but run on some hacked/custom bugfix directly in the extjs source.
    Sven Tore Iversen

  6. #6
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    220

    Default

    svenna, I have the problem with 6.0.1: you can also try my Fiddle.

  7. #7
    Sencha Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    658

    Default

    Thanks.. just realiced that before upgrading the workspace to 6.0.2 I was running on 6.0.1-hacked.

    ..now I just have to figure out what I modified and try the same workaround on 6.0.2 (will report if I find it)
    Sven Tore Iversen

  8. #8
    Sencha Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    658

    Default

    After doing som more testing I find that my particular issue on on my current app is working with 6.0.1, but not in 6.0.2.

    After a bit of debugging I found that Ext.grid.filters.Filters.onReconfigure is changed in 6.0.2, and I've have created an overrride that seems to solve my issue.

    Code:
    Ext.define('myapp.overrides.gridfilter', {
        override: 'Ext.grid.filters.Filters',
    
        onReconfigure: function(grid, store, columns, oldStore) {
            var me = this,
                filterMenuItem = this.filterMenuItem,
                changed = oldStore !== store,
                key;
            // The Filters item's menu should have already been destroyed by the time we get here but
            // we still need to null out the menu reference.
            if (columns) {
                for (key in filterMenuItem) {
                    filterMenuItem[key].setMenu(null);
                }
            }
            if (store) {
                if (oldStore && !oldStore.destroyed && changed) {
                    me.resetFilters(oldStore);
                }
                if (changed) {
                    me.bindStore(store);
                    //me.applyFilters(store); //bug introduced in 6.0.2 that triggers an unwanted store load
                }
            }
            me.initColumns();
        }
    });
    Sven Tore Iversen

  9. #9
    Sencha Premium User
    Join Date
    Nov 2013
    Location
    Piacenza, Italy
    Posts
    220

    Default

    So it seems a different bug than this: I think it would be better to open a new thread for the specific issue of 6.0.2, so it can be tracked separately from this one (else probably it will never get fixed).
    It could be useful also a cross-link between the two bug reports!

  10. #10
    Sencha User
    Join Date
    Mar 2016
    Posts
    39

    Default

    Found the same bug in ExtJS 6.2.0.981. Still not fixed?

    @agarberi workaround helps me.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 18 Dec 2015, 4:09 PM
  2. Replies: 3
    Last Post: 25 Sep 2013, 7:00 AM
  3. [NOREPRO] [4.2] Store autoLoad=false ignored when remoteSort=true
    By dnoizet in forum Ext:Bugs
    Replies: 1
    Last Post: 28 Mar 2013, 6:34 AM
  4. Replies: 0
    Last Post: 1 Jul 2011, 12:21 AM

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
  •