Results 1 to 3 of 3

Thread: Grid page number not changing after store.load

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Vote Rating

    Default Answered: Grid page number not changing after store.load

    Hi Guys,

    I have the following grid:

    createSearchGrid    : function()    {
            var me = this,
            store = me.createStore(),
            columns    = me.createColumns(),
            paging = me.createPaging(store),
            topBar = me.createTopBar(),
            panel = Ext.create("Ext.grid.Panel",{
                title        : "Search",
                id            : "myGrid",
                columns     : columns,
                tbar        : topBar,
                dockedItems :  [paging],
                store       : store
    The top bar looks like this:
    createTopBar    : function(){
            var me = this,
            tbar = [],
            searchField    = {
                xtype        : "textfield",
                id            : "searchField"
            searchBtn    = {
                xtype    : "button",
                text       : "Search"
                handler    : function(){
            tbar.push(searchField, searchBtn);
            return tbar;
    And finally my searchStore function is as follows:
    searchStore    : function(){
            var field = Ext.getCmp("searchField"),
            store = Ext.getCmp("myGrid").getStore(),
            value = field.getValue();
    When I refresh the store it all works fine. It loads with page param set to 1 but when the page number in the grid paging remains whatever it was last. Any ideas?

    I'm using extjs 4.1.3

  2. Never mind. When using the above method and using store.loadPage(1) when performing a search it all works fine. Hope this helps someone else as well, I find this to be pretty handy code.

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