Results 1 to 3 of 3

Thread: Grid, current page and new totalRecords

  1. #1
    Sencha User evgenspb's Avatar
    Join Date
    Jun 2010
    Location
    Russia Saint-Petersburg
    Posts
    38
    Answers
    1
    Vote Rating
    14
      0  

    Default Grid, current page and new totalRecords

    Hello,
    I have some problem with paging at grid with remote filtering.

    Grid has 1000 records.
    Page size is 100.
    User moves to page number 2.
    User applies some external (not grid member) filter.
    User press refresh button at paging bar.
    Store applies filter data by code
    PHP Code:
    listeners:{    beforeLoad: function (store){            
    store.getProxy().extraParams.query Ext.ComponentManager.get("vendorfilter").value;   
     }} 
    Server-side script build new query and generate response with 56 records.
    But page is 2, There is no page 2 now!
    Well, server can send empty page or last page.
    If server send empty recordset, paging bar is disabled.
    If server send last page, paging bar looks funny
    "page 7 from 1" and "Displaying 101-56 of 56"

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You can use loadPage method on the store to specify to go to page 1
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User evgenspb's Avatar
    Join Date
    Jun 2010
    Location
    Russia Saint-Petersburg
    Posts
    38
    Answers
    1
    Vote Rating
    14
      0  

    Default

    You are right.
    I have solved this problem by event.
    But I guess store (or/and grid or/and paging panel) should to know about new totalRecords from last package.

    Thank you.
    Evgeny

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
  •