1. #1
    Ext User
    Join Date
    Jan 2008
    Posts
    8
    Vote Rating
    0
    bobbymunk is on a distinguished road

      0  

    Default Server Side Paging - Passing Page Number / List Size

    Server Side Paging - Passing Page Number / List Size


    Im trying to call a ColdFusion CFC via a URL with different page number / list size params each request.

    This is SERVER SIDE PAGING

    I've figured out I can use something like:


    // Add the HTTP parameter(s) searchTerm to the request

    store
    .proxy.on('beforeload', function(proxy, params) {

    params.pageNumber =5;
    params.listSize =25;


    });

    How do I make the 5 and 25 in this code dynamic based upon whats been clicked on in the paging bar on each request?

    I may be missing something fundamental here, but surely I can use something like
    Ext.PagingToolbar.NewPageRequested.GetValue() etc to add a GET variable to the URL.


    Thanks

    Dave

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,501
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You don't have to do anything. The PagingToolbar handles it all for you.

  3. #3
    Ext User
    Join Date
    Jan 2008
    Posts
    8
    Vote Rating
    0
    bobbymunk is on a distinguished road

      0  

    Default


    Thats what I had initially thought with this line:

    store.load({params:{start:0, limit:this.pageSize}});

    ... but when I click next the same initial 25 records load even though it shows up as being on page 2.

    Therefore the page number isnt being passed to my CFC correctly.

    It does a POST, correct?

    My thinking was to set it as a GET with the LISTENER, as im eventually going to add other extra params in this way?

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,501
    Vote Rating
    47
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    "Therefore"?? Is that how you debug?

    Have you looked at the post data with Firebug?

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    89
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    PagingToolbar adds start and limit parameters to the request, but not pageNumber and listSize parameters.

    Try:

    Code:
    store.on('beforeload', function(store, options) {
      var start = options.params.start;
      delete options.params.start;
      var limit = options.params.limit;
      delete options.params.limit;
      options.params.pageNumber = Math.floor(start / limit);
      options.params.listSize = limit;
      return true;
    });

  6. #6
    Ext User
    Join Date
    Jan 2008
    Posts
    8
    Vote Rating
    0
    bobbymunk is on a distinguished road

      0  

    Default


    Fair comment, its just I'd seen an example on the net using the listener, but I guess looking at the post I can see the problem now

    Thanks for you help.

  7. #7
    Ext User
    Join Date
    Jan 2008
    Posts
    8
    Vote Rating
    0
    bobbymunk is on a distinguished road

      0  

    Default


    Thanks Condor, I will use the options.params.pageNumber, for the value I need for my paging script

    Thanks for your help.

    Cheers

  8. #8
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    I would bet that the more likely solution is your backend code is ignoring the params being sent through, so it is returning the same recordset each time. add some debugging code to your backend and use firebug to confirm/deny this.

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi