Nov 25, 2009, 9:18 AM
[CLOSED] [0.8.2] PagingToolbar Not Showing Correct Total
Hi,
I am loading data into a (paging) store using the following:
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:
Which is this code:
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.
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.