I was trying to get the Paging working with XML and could not get it working.
Summary: I had to update the following code in the base to fix the issue.
Side Note
I have only been using this API since Thursday, so I am very new. So if I am way off base please accept my appologies in advance and let me know how to fix this without an update to the base code.
Great stuff and I look forward to much contribution.
The Issue:
Paging was only showing total for the page, not grand total when using XML output.
The Fix:
A minor two word update in the readRecords function of Ext.data.XmlReader fixed the issue.
Original Code
Extra code included to show context of the update.
Code:
Ext.extend(Ext.data.XmlReader, Ext.data.DataReader, {
read : function(response){
var doc = response.responseXML;
if(!doc) {
throw {message: "XmlReader.read: XML Document not available"};
}
return this.readRecords(doc);
},
readRecords : function(doc){
this.xmlData = doc;
var root = doc.documentElement || doc;
var q = Ext.DomQuery;
var recordType = this.recordType, fields = recordType.prototype.fields;
var sid = this.meta.id;
var totalRecords = 0;
if(this.meta.totalRecords){
totalRecords = q.selectNumber(this.meta.totalRecords, root, 0);
}
Updated Code
Note: Changed totalRecords to totalProperty at the very bottom of the code - shown below:
Code:
if(this.meta.totalProperty){
totalRecords = q.selectNumber(this.meta.totalProperty, root, 0);
}
Other Notes:
I had to also figure out to accept the start and limit parameters in my agent that were being appended .. only when setting the method to GET.
So if anyone is having issues with parameters not working, try using method: GET along with url.
If anyone is having issues with too many being returned, assure the process getting the parameters knows is returning the proper number based on start and limit query_string params.