Results 1 to 3 of 3

Thread: After clearing filter(s) of store, type query does not work

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    327
    Answers
    10

    Default After clearing filter(s) of store, type query does not work

    I'm using instances of a combobox for multiple user interfaces. So I need to reset combobox stores when user focuses on it. Combo's store is locally sorted; so I execute clearFilter() function of Ext.data.Store class - it works as it is expected except that typing query does not work anymore.


    Here is my combobox configuration:

    Code:
    forceSelection: true,
    autoSelect: false,
    typeAhead: false,
    triggerAction: 'all'

    Store configuration:


    Code:
    autoLoad: false,
    autoSync: false,
    remoteSort: false,
    proxy: {
        type: 'ajax'
        // other configs
    }

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    Can you provide a fiddle (https://fiddle.sencha.com) demonstrating the issue so I can work with you on resolving this?
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3

    Join Date
    Dec 2013
    Location
    Italy
    Posts
    88
    Answers
    9

    Default

    Not sure about this solution, I think the combo should maintain the query value in "lastQuery" field. Try to append a listener (only to remote-editable combos) like this:
    Code:
                    beforequery: function(qe) {
                        if (!qe.query && qe.combo.lastQuery) {
                            qe.query = qe.combo.lastQuery;
                        }
                    }

    I had the same need on local sotres and anymatch filter, my solution for that is

    Code:
                Ext.define('Ext.data.StoreOverrideForAnyMacth', {
                    override: 'Ext.data.Store',
                    clearFilter: function(suppressEvent) {
                        var anyMatchFilters = this.filters.filter('anyMatch', true);
                        this.callParent(arguments);
                        this.filters = anyMatchFilters;
                    }
                });

Similar Threads

  1. Replies: 3
    Last Post: 10 Feb 2015, 5:28 AM
  2. Replies: 2
    Last Post: 1 Nov 2013, 5:18 AM
  3. Replies: 5
    Last Post: 17 Mar 2011, 11:25 PM
  4. Replies: 6
    Last Post: 20 Oct 2010, 11:59 AM
  5. beforequery clearing store's filter
    By MattMyob in forum Sencha Ext JS Q&A
    Replies: 9
    Last Post: 20 Apr 2008, 5:52 PM

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
  •