Results 1 to 2 of 2

Thread: Search field and paging toolbar work wrong together in some cases

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Default Search field and paging toolbar work wrong together in some cases

    Sorry. It is for ExtJS 4.0.1 please move!!!

    Example. We are on the page 3 of the result set and we want to search something. The found results fit into one page. In that case the paging toolbar stays in the state

    Page 3 of 1

    and the grid is empty, although some results are there.

    To solve this problem, small corrections in the SearchField.js are necessary.

    Use

    store.loadPage(1);

    insted of

    store.load();

    If we are about to search, we do not need to keep the current page, the current page might be invalid at all for found results, an we can surely start the search reults with the first page.

    Code:
        onTrigger1Click : function(){
            var me = this,
                store = me.store,
                proxy = store.getProxy(),
                val;
                
            if (me.hasSearch) {
                me.setValue('');
                proxy.extraParams[me.paramName] = '';
                proxy.extraParams.start = 0;
                store.loadPage(1);
                me.hasSearch = false;
                this.updateElementSizes(false);
                me.triggerEl.item(0).setDisplayed('none');
                me.doComponentLayout();
            }
        }, // onTrigger1Click
    
        onTrigger2Click : function(){
            var me = this,
                store = me.store,
                proxy = store.getProxy(),
                value = me.getValue();
                
            if (value.length < 1) {
                me.onTrigger1Click();
                return;
            }
            proxy.extraParams[me.paramName] = value;
            proxy.extraParams.start = 0;
            store.loadPage(1);
            
            var hadSearch = me.hasSearch;
            me.hasSearch = true;
            me.triggerEl.item(0).setDisplayed('block');
            if(!hadSearch) this.updateElementSizes(true);
            me.doComponentLayout();
        }, // onTrigger2Click

  2. #2
    Sencha User
    Join Date
    Sep 2012
    Posts
    17

    Default

    i got the same issu

Posting Permissions

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