[CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

  1. #1

    [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    Hi,

    I am loading data into a (paging) store using the following:


    dsSearch.loadData(result.responseXML, false);

    The responseXML contains my total records count and the store has a correctly configured reader. When debugging through the javascript I can see that the correct number of records are assigned to the stores totalLength variable.


    However, when my PagingToolbar updates itself using updateInfo() function it executes the following line:


    this.store.getTotalCount()

    Which is this code:


    getTotalCount : function () {
        return this.allData ? this.allData.getCount() : this.totalLength || 0;
    },

    This function is returning the allData.getCount() total which is my loaded data (50 records, page size of 50). Instead of the totalLength value that I actually want (which is the total number of records, 1294 in my case).


    Therefore my PagingToolbar is only showing 1 page and 1 - 50 of 50 records not 1 - 50 of 1294 records.


    Is there something else I need to do to get the correct value displaying?


    The reason I am loading data this way is because I need to submit a form to the server and use the values of the form to generate an XML results set. I am submitting the form using an Ajax request and then processing the result as above. Normally I would use an HttpProxy and everything would work fine but I cannot in this case.

  2. #2

    RE: [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    Hi,

    Try to set RemotePaging="true" for the Store
  3. #3

    RE: [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    Thank you for the suggestion, the behaviour is the same though.



  4. #4

    RE: [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    Hi,

    Do you use any proxy? Remote paging is possible with proxy only
  5. #5

    RE: [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    No I don't so that is most likely the problem. How can I get my form collection to pass through with the request that the proxy makes to the server?

    I don't really want to have to encode it some how and pass it with a Parameter on the store because on the server I like to access the variables via the Request.Form array because a) there are a lot of values and b) the values are dynamic across the application.


    Is it possible to pass the form to the store's load function via the options parameter?
  6. #6

    RE: [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    Hi,

    If you bind the store in the page then use DataSourceProxy (PageProxy in 1.0 version). In this case all form fields will be available on server side (please note that in this case you can use JsonReader only)


    Otherwise you can always serialize form and pass it as single parameter
    Ext.Ajax.serializeForm('form1')
    or
    Ext.Ajax.serializeForm(document.forms[0])
  7. #7

    RE: [CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total

    That's great thank you, that will bring my parameters to the server.

    Are there any pre-written routines for deserializing the string back to a NameValueCollection?


    I'm guessing not, I presume if I want to write my own I just need to split on & and then on = and then urldecode the name and value?

Similar Threads

  1. How to set total page for pagingtoolbar?
    By tienthanh in forum 1.x Help
    Replies: 4
    Last Post: Jun 04, 2012, 4:48 AM
  2. [CLOSED] store total record count assign (e.Total)
    By majestic in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 23, 2012, 12:13 PM
  3. Grid Total
    By sneha in forum 1.x Help
    Replies: 9
    Last Post: Jan 18, 2012, 6:32 AM
  4. [CLOSED] Grouping Total Row
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 11, 2011, 11:35 AM
  5. [CLOSED] Grouping Total Row
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 07, 2011, 10:42 AM

Posting Permissions