jQuery UI Widgets › Forums › Grid › Server Paging Problem
Tagged: data, grid, jqxgrid, page, pagechanged, paging, parameter, pass parameter, server, server pageing, server side paging, server-side
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 10 years ago.
-
AuthorServer Paging Problem Posts
-
There is a problem with the display of the last page of the table using the paging server
Outputting the data is not correct
example:
$(“#grid”).jqxGrid(
{
width: ‘100%’,
showaggregates: true,
showstatusbar: true,
theme: ‘metro’,
pageable: true,
columnsresize: true,
showfilterrow: true,
filterable: true,
virtualmode: true,
rendergridrows: function (obj) {
return obj.data;
},
pagesizeoptions: [‘5′, ’20’, ’50’, ‘100’],
pagesize: 5,
localization: getLocalization(),
columns: [
/*initialization columns*/
]
});$.post(‘/Home/GetTransaction’, {
dateEnd: new Date($(“#dateStart_Raw”).jqxDateTimeInput(‘getDate’)).toISOString(),
dateStart: new Date($(“#dateStart_Raw”).jqxDateTimeInput(‘getDate’)).toISOString(),
ServicesList: $(‘select[name=ServicesList]’).val(),
SupplierList: $(‘select[name=SupplierList]’).val()
}, function (data) {
var source =
{
datatype: “json”,
datafields: [
{ name: ‘Account’, type: ‘string’ },
{ name: ‘Amount’, type: ‘float’ },
{ name: ‘Card_amount’, type: ‘float’ },
{ name: ‘Cash_amount’, type: ‘float’ },
{ name: ‘Ecard_amount’, type: ‘float’ },
{ name: ‘BankAccount’, type: ‘float’ },
{ name: ‘BankMfo’, type: ‘float’ },
{ name: ‘BankName’, type: ‘string’ },
{ name: ‘BankName2’, type: ‘string’ },
{ name: ‘CommissionClient’, type: ‘float’ },
{ name: ‘CommissionProvider’, type: ‘float’ },
{ name: ‘Currency’, type: ‘string’ },
{ name: ‘DatePayment’, type: ‘date’ },
{ name: ‘PaymentDetails’, type: ‘string’ },
{ name: ‘ServiceId’, type: ‘int’ },
{ name: ‘ServiceName’, type: ‘string’ },
{ name: ‘StatusId’, type: ‘float’ },
{ name: ‘SuplierId’, type: ‘int’ },
{ name: ‘SupplierEdrpou’, type: ‘string’ },
{ name: ‘SupplierName’, type: ‘string’ },
{ name: ‘TerminalId’, type: ‘int’ },
{ name: ‘TransactionId’, type: ‘long’ }
],
localdata: data.Rows,
totalrecords: data.TotalRows
};
var dataAdapter = new $.jqx.dataAdapter(source);
// initialize jqxGrid
$(“#grid”).jqxGrid(
{
source: dataAdapter
});
});
Here everything is working properly
Paging works like this:
$(“#grid”).on(“pagechanged”, function (event) {
var args = event.args;
var pageNum = args.pagenum;
var pageSize = args.pagesize;
$(“#grid”).jqxGrid(‘showloadelement’);
$.post(‘/Home/GetTransactionPage’, {
pagesize: pageSize, pagenum: pageNum,
dateEnd: new Date($(“#dateEnd_Raw”).jqxDateTimeInput(‘getDate’)).toISOString(),
dateStart: new Date($(“#dateStart_Raw”).jqxDateTimeInput(‘getDate’)).toISOString(),
ServicesList: $(‘select[name=ServicesList]’).val(),
SupplierList: $(‘select[name=SupplierList]’).val()
}, function (data) {
var source =
{
type: “GET”,
datatype: “json”,
datafields: [
{ name: ‘Account’, type: ‘string’ },
{ name: ‘Amount’, type: ‘float’ },
{ name: ‘Card_amount’, type: ‘float’ },
{ name: ‘Cash_amount’, type: ‘float’ },
{ name: ‘Ecard_amount’, type: ‘float’ },
{ name: ‘BankAccount’, type: ‘float’ },
{ name: ‘BankMfo’, type: ‘float’ },
{ name: ‘BankName’, type: ‘string’ },
{ name: ‘BankName2’, type: ‘string’ },
{ name: ‘CommissionClient’, type: ‘float’ },
{ name: ‘CommissionProvider’, type: ‘float’ },
{ name: ‘Currency’, type: ‘string’ },
{ name: ‘DatePayment’, type: ‘date’ },
{ name: ‘PaymentDetails’, type: ‘string’ },
{ name: ‘ServiceId’, type: ‘int’ },
{ name: ‘ServiceName’, type: ‘string’ },
{ name: ‘StatusId’, type: ‘float’ },
{ name: ‘SuplierId’, type: ‘int’ },
{ name: ‘SupplierEdrpou’, type: ‘string’ },
{ name: ‘SupplierName’, type: ‘string’ },
{ name: ‘TerminalId’, type: ‘int’ },
{ name: ‘TransactionId’, type: ‘long’ }
],
root: ‘Rows’,
localdata: data,
totalrecords:data.TotalRows
}
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#grid”).jqxGrid({ source: dataAdapter });
});
});
Everything works, but on the last page, the data is not displayed
When I put a breakpoint, and turn on the penultimate page.
before receiving the data, see the data from the last page displayed on the second page.Thank You for help
Hello EPSakhno,
Please refer to the available server-side paging help topics: Server Side Paging with jqxGrid using PHP and MySQL, Server-Side Paging with jqxGrid, ASP.NET MVC 3 and SQL or Server Paging with jqxGrid, ASP.NET and SQL. We hope one of these helps you implement this functionality as you require.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks
Another question.
I need to ask for resources to pass parameters to the method.
example:
var source = {
datatype: “json”,
datafields: [{name: ‘ShippedDate’, type: ‘date’},
{Name: ‘ShipName’},
{Name: ‘ShipAddress’},
{Name: ‘ShipCity’},
{Name: ‘ShipCountry’}],
url: ‘Orders / GetOrders’,
root: ‘Rows’,
beforeprocessing: function (data) {
source.totalrecords = data.TotalRows;
}
};
But GetOrders method, I want to pass a value:
new Date ($ (“# dateEnd_Raw”). jqxDateTimeInput (‘getDate’)). toISOString ()
As indicated in the resource?Hi EPSakhno,
You can use the source data property to pass data to the server. For more information, please refer to the jqxDataAdapter help topic. You may also find the tutorial Add extra HTTP variables helpful.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.