Hi, I have my grid like this:
var source = {
type: 'post', url: 'inc/getOrders.php', datatype: "json", cache: false,
data: {},
datafields: [
{ name: 'OrderNbr', type: 'int'},{ name: 'TypeOf', type: 'string'},
{ name: 'State', type: 'string'},{ name: 'CustomerName', type: 'string'},
{ name: 'Active', type: 'string'}
],
id: 'OrderNbr',
root: 'Rows',
beforeprocessing: function(data) {
console.log(data[0].totalrecords);
source.totalrecords = data[0].totalrecords;
}
}
var dataAdapter = new $.jqx.dataAdapter(source,
{
loadComplete: function () {},
loadError: function(xhr, status, error) {
console.log(xhr.responseText);
}
});
$("#grid").jqxGrid( {
source: dataAdapter,
theme:'energyblue',
width: 800, height: 500,
columnsresize: true, sortable: true, enabletooltips: true,
pageable: true, pagesize: 50, virtualmode: false, pagesizeoptions: ['20', '50', '100', '200'],
rendergridrows: function(obj) {
return obj.data;
},
columns: [
{ text: 'Order', datafield: 'OrderNbr', width: 100},
{ text: 'Type', datafield: 'TypeOf', width: 200},
{ text: 'State', datafield: 'State', width: 200},
{ text: 'Customer', datafield: 'CustomerName', width: 200},
{ text: 'Active?', datafield: 'Active', width: 50}
]
});
I tested the server side php script and it retrieves 198 records from DB.
When virtualmode is true, the 198 records are retrieved and the paginator works as expected.
When virtualmode is false, only the first 50 records are shown. Paginator shows: “1-50 of 50” (only 1 page with 50 records and pressing on ‘next page’ button does nothing)
Although console.log(data[0].totalrecords) on beforeprocessing always outputs 198
Thanks in adv
Omar.