Here is the problem,
Server responds with several records in JSON, which number is greater than grid pageSize parameter specified in the Store. The total number is not returning by a server in this JSON with data. The number of such records is known and could be different (this number should be requested from the server in another request). The total number is needed for the pagingtoolbar.
How to tell the proxy reader this number from the view controller?
The only workable solution I found is to override the Ext.data.reader.Json reader with the following code:
Ext.define('MyApp.custom.AnotherReader',{
extend: 'Ext.data.reader.Json',
alias : 'reader.anotherReader',
// разбираем ответ и записываем в store
getResponseData : function(response) {
var st = Ext.decode(response.responseText);
st.total = 5;
//console.log(st);
return st;
}
});
The problem is I cannot dynamically change this total parameter from the viewcontroller.
JSON 1:
[
{
"id":"1",
"user_id":"11",
},
{
"id":"2",
"user_id":"12",
},
{
"id":"3",
"user_id":"13",
},
{
"id":"4",
"user_id":"14",
},
{
"id":"5",
"user_id":"15",
}
]
JSON 2:
{
"records_count": "5"
}
getResponse
function. Why not dost.total = the_array_for_your_store.length
? – SelfSurgeryarray.splice
– SelfSurgery