Hybrid View

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    92
    Vote Rating
    54
    Answers
    2
    bobmanc is a jewel in the rough bobmanc is a jewel in the rough bobmanc is a jewel in the rough

      0  

    Default Answered: paging toolbar page not updating

    Answered: paging toolbar page not updating


    I am using a paging toolbar and if I manually click to the second page it works fine but if I then issue a
    store().load({params:{start:0,limit:10}}); the load works correctly, the first 10 records are sent back but the toolbar still says Page 2. Any ideas?

    I am using ExtJS 4.1. Thanks.

  2. so you can use moveFirst method of PagingToolbar component. It should do the same with clicking first page icon on PagingToolbar.

  3. #2
    Sencha User
    Join Date
    Jan 2011
    Location
    San Juan, PR
    Posts
    82
    Vote Rating
    5
    vela1606 is on a distinguished road

      0  

    Default


    is your totalProperty correct?

    PHP Code:

    {   
         
    "success"true,    
         
    "results"2000, <-------// this    
         
    "rows": [ // ***Note:** this must be an Array        
              
    "id":  1"name""Bill""occupation""Gardener" },        
              { 
    "id":  2"name":  "Ben""occupation""Horticulturalist" },
               ...        
              { 
    "id"25"name":  "Sue""occupation""Botanist" }   
          ]

    |:| GaiaEHR |:| A Open Source Software for Electronic Health Records - Lead Developer

  4. #3
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    305
    Vote Rating
    0
    Answers
    8
    talha06 is on a distinguished road

      0  

    Default


    Actually you don't need to load store with start and limit parameters. All you need is setting pageSize configuration in your store.

    Then you can call store's load method without any extra parameters. Store will take care of start and limit paramaters. It'll load store with incremented start parameter on each page load.
    "People will never forget how you made them feel."
    linkedin.com/in/talhakabakus

  5. #4
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    92
    Vote Rating
    54
    Answers
    2
    bobmanc is a jewel in the rough bobmanc is a jewel in the rough bobmanc is a jewel in the rough

      0  

    Default


    The total returned is correct.

    I need to reset the start param so it gets the first ten records (which it does) instead of the second ten. Everything on the server side is working correctly. The only problem is the page number doesn't reset to 1 but stays at 2.

  6. #5
    Sencha User talha06's Avatar
    Join Date
    Jul 2009
    Location
    Turkey
    Posts
    305
    Vote Rating
    0
    Answers
    8
    talha06 is on a distinguished road

      0  

    Default


    so you can use moveFirst method of PagingToolbar component. It should do the same with clicking first page icon on PagingToolbar.
    "People will never forget how you made them feel."
    linkedin.com/in/talhakabakus

  7. #6
    Sencha Premium Member
    Join Date
    Apr 2007
    Posts
    92
    Vote Rating
    54
    Answers
    2
    bobmanc is a jewel in the rough bobmanc is a jewel in the rough bobmanc is a jewel in the rough

      0  

    Default


    That did it. I never would have thought MoveFirst would be the name for the method. It should be SetPage or something similar. Thanks for the help.

Thread Participants: 2