ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: orlando_acevedo on December 18, 2018, 01:28:23 am
-
Hi pqTeam,
I recently upgraded to v5.6, and the sorting is not working anymore in an Infinite Scrolling scenario.
Here is the grid code:
var obj = {
sortModel: { type: 'remote', sorter: [{ dataIndx: 'AuditID', dir: 'down' }] },
numberCell: { show: false },
filterModel: { on: true, header: true, type: 'remote' },
showTop: false,
menuIcon: true,
menuUI: {
tabs: ['filter']
},
height: 500,
flex: { one: true },
wrap: false,
freezeCols: 1,
editable: false,
collapsible: false,
resizable: true,
// Callback Functions:
beforeSort: function (evt) {
if (evt.originalEvent) {//only if sorting done through header cell click.
pqIS.init();
}
},
beforeFilter: function () {
pqIS.init();
},
beforeTableView: function (evt, ui) {
var finalV = ui.finalV,
data = pqIS.data;
if (ui.initV == null) {
return;
}
if (!pqIS.pending && finalV >= data.length - 1 && data.length < pqIS.totalRecords) {
pqIS.requestPage++;
pqIS.pending = true;
//request more rows.
this.refreshDataAndView();
}
}
};
obj.colModel = [
{
title: "Audit ID", dataIndx: "AuditID", minWidth: "90", dataType: 'integer',
render: function (ui) { return { style: "text-decoration: underline;", text: "<a href='/Audits/Details/" + ui.cellData + "'>" + ui.cellData + "</a>" } },
filter: { crules: [{ condition: 'equal' }], listener: 'change' }
},
{
.....
And the dataModel:
obj.dataModel = {
dataType: "JSON",
location: "remote",
url: '@Url.Action("AuditInfiniteData", "Audits")',
postData: function () {
return {
pq_curpage: pqIS.requestPage,
pq_rpp: pqIS.rpp,
};
},
getData: function (response) {
var data = response.data,
len = data.length,
curPage = response.curPage,
pq_data = pqIS.data,
init = (curPage - 1) * pqIS.rpp;
pqIS.pending = false;
pqIS.totalRecords = response.totalRecords;
for (var i = 0; i < len; i++) {
pq_data[i + init] = data[i];
}
return { data: pq_data }
}
//,
//error: function (jqXHR, textStatus, errorThrown) {
// //alert("There has been an error.\nPlease contact Orlando Acevedo at orlando.acevedo@chep.com.\nERROR: " + errorThrown);
// alert("There has been an error.\nPlease contact Orlando Acevedo at orlando.acevedo@chep.com.\nERROR: " + errorThrown);
//}
};
-
From which version have you upgraded your code?
Apparently your code looks fine. Do you get any error in the browser console or in your remote script.
There is no change and no known issue in remote sorting, it works fine in infinite scrolling demo:
https://paramquery.com/pro/demos/infinite_scroll