You found a bug! We've classified it as a bug in our system. 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
    Jan 2011
    Posts
    3
    Vote Rating
    0
    xkulio is on a distinguished road

      0  

    Default [3461] ExtJS4 store suspendEvents clearFilter problem

    [3461] ExtJS4 store suspendEvents clearFilter problem


    Hi all,

    I'm having a problem while suspending events on a remote sort/filter store. I'm trying to clear filters and setting a new one, but my server is receiving 2 queries, one without filters and another one with new filter. Mi code:

    Code:
    store.suspendEvents(false);
    store.clearFilter(true);
    store.resumeEvents();
    store.filter({
        property: prop,
        anyMatch: true,
        value   : value
    });

    This is not suposed to work?

  2. #2
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Agreed - that's not a good behavior. Moved to the bugs forum and pushed into our tracker to get this fixed for 4.1
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  3. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    3
    Vote Rating
    0
    xkulio is on a distinguished road

      0  

    Default


    The quick fix right now could be something like this:

    Code:
    store.remoteFilter = false;
    store.clearFilter(true);
    store.remoteFilter = true;  
    
    store.filter({
        property: prop,
        anyMatch: true,
        value   : value
    });
    But property remoteFilter is not documented on Ext.data.Store

  4. #4
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Quote Originally Posted by xkulio View Post
    But property remoteFilter is not documented on Ext.data.Store
    Yes it is... see http://docs.sencha.com/ext-js/4-0/#/api/Ext.data.Store
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  5. #5
    Sencha User
    Join Date
    Apr 2011
    Posts
    19
    Vote Rating
    0
    manyu.tomar is on a distinguished road

      0  

    Default


    same problem here, it seems store.suspendEvents() is not working in extjs 4 .
    or its calling resume events even after setting it to false .


  6. #6
    Sencha Premium Member Nxs's Avatar
    Join Date
    Mar 2012
    Posts
    43
    Vote Rating
    2
    Nxs is on a distinguished road

      0  

    Default


    Quote Originally Posted by xkulio View Post
    The quick fix right now could be something like this:

    Code:
    store.remoteFilter = false;
    store.clearFilter(true);
    store.remoteFilter = true;  
    
    store.filter({
        property: prop,
        anyMatch: true,
        value   : value
    });
    But property remoteFilter is not documented on Ext.data.Store
    Thank you !

  7. #7
    Sencha User
    Join Date
    Jun 2013
    Posts
    20
    Vote Rating
    2
    asankaub is on a distinguished road

      0  

    Default


    can do like this also
    Code:
    var isRemoteFilter = store.remoteFilter;								this.store.remoteFilter = false;
    								this.store.clearFilter(true);
    								this.store.remoteFilter = isRemoteFilter;