1
Help for ParamQuery Pro / remote sorting not working after upgrading to v5.6
« 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:
And the dataModel:
I recently upgraded to v5.6, and the sorting is not working anymore in an Infinite Scrolling scenario.
Here is the grid code:
Code: [Select]
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:
Code: [Select]
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 [email protected].\nERROR: " + errorThrown);
// alert("There has been an error.\nPlease contact Orlando Acevedo at [email protected].\nERROR: " + errorThrown);
//}
};