So my app is talking to a soap server that returns all values for a given call (server doesn't limit results). I want to use the paging memory proxy so that I can load all results into memory and then present the paged grid to the user based on page size settings. It seems that all the results are retrieved (pagingbar message says showing 1-5 of 17 with 4 pages) and that my array slice works since I only see the limit amount of 5, but when I hit the pager next button a call to the server is again made, instead of paging from memory and the same first 5 values are displayed.
I can currently limit the size of the intitial grid by setting my params as follows:
(This is passed to the SoapProxy and stored as the proxy in the json reader)
Code:
var o = {
url : "/test.wsdl",
method : "sGetAll",
namespace: "test",
disableCaching: false,
params : {
sReq: "subscriber",
tag : "subscriber",
start: 0,
limit: 5
}
};
var proxy = new Ext.ux.soap.SoapProxy(o);
This is the loadResponse inside the SoapProxy extension
Code:
loadResponse : function(options, success, response) {
delete this.activeRequest;
if(!success){
this.fireEvent("loadexception", this, options, response);
this.callback.call(this.scope, null, this.arg, false);
return;
}
var result;
try {
result = this.reader.read(Ext.ux.soap.getXML(response), this.url, this.method); //reader needs also url and methodName
console.dir(result);
}catch(e){
this.fireEvent("loadexception", this, options, response, e);
this.callback.call(this.scope, null, this.arg, false);
return;
}
this.fireEvent("load", this, options, this.arg);
// paging (use undefined cause start can also be 0 (thus false))
if (this.params.start!==undefined && this.params.limit!==undefined) {
result.records = result.records.slice(this.params.start, this.params.start+this.params.limit);
}
this.callback.call(this.scope, result, this.arg, true);
},
In the Grid extension:
Code:
this.bbar = new Ext.PagingToolbar({
store:this.store
,displayInfo:true
,pageSize:5
});