1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    2
    Vote Rating
    0
    saubua is on a distinguished road

      0  

    Default paging and remoteSort

    paging and remoteSort


    Hello,

    great framework!

    I'm using a store with a PaingToolbar. Everything works fine so far, but I can't figure out how to force the grid to page 1 after clicking on a sortable header.
    If I'm on page 2 it fire the correct request, but it stays on page 2. I want it to go to the beginning.

    Any ideas?

    thanks,
    saubua

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,546
    Vote Rating
    64
    Animal is a jewel in the rough Animal is a jewel in the rough Animal is a jewel in the rough

      0  

    Default


    Where dataSource is your DataSource and myPageSize is your page size:
    Code:
        dataSource.load({params:{start: 0, limit: myPageSize}});

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    2
    Vote Rating
    0
    saubua is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal
    Where dataSource is your DataSource and myPageSize is your page size:
    Code:
        dataSource.load({params:{start: 0, limit: myPageSize}});
    OK, thanks.
    But where should I put this line of code?

    Ext.Store.sort() calls Ext.store.load() calls proxy.load()
    and proxy does not know anything about sorting...

  4. #4
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    cembry@opentext.com is on a distinguished road

      0  

    Default


    Did you ever find a solution to this? I am looking for the same thing.

  5. #5
    Sencha User Vital Aaron's Avatar
    Join Date
    Jun 2011
    Posts
    24
    Vote Rating
    0
    Vital Aaron is on a distinguished road

      0  

    Default


    If you're looking for a 4.x solution to this problem (and given the date of your post, I kind of hope you are) then add the following to your store definition:

    Code:
        doSort: function() {
        this.currentPage = 1;
        this.callParent(arguments); 
       }
    This works if your store is defined as an extension of Ext.data.Store:
    Code:
        Ext.define('pagingStore', {
        extend : 'Ext.data.Store',...
        }
       yourStore = Ext.create('pagingStore');

Similar Threads

  1. a2: Datastore: remotesort fails if name is not equal mapping
    By Wolfgang in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 12 Mar 2007, 12:45 PM
  2. Paging Grid...
    By fredstra in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 7 Mar 2007, 7:55 AM
  3. Help with POST and paging
    By Hillgod in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 6 Mar 2007, 8:06 AM
  4. regarding paging grid
    By noname in forum Ext 1.x: Help & Discussion
    Replies: 7
    Last Post: 1 Mar 2007, 4:54 AM

Thread Participants: 3