We are getting duplication data issues with the grid. The steps, we followed as below.
1) Load data with grid - looks fine (refer to the screenshot - SRC_1.png)
2) Apply the range filter to the "N.Value" column (refer to the screenshot - SRC_2.png) - showing a duplicate "0.00" value
3) Select "0.00" & apply a filter to get the duplicate rows (refer to the screenshot - SRC_3.png)
Please advise the solution to fix the duplicate data issue.
My grid code is as below:
var loGroupModel =
{
on: false,
summaryInTitleRow: 'all',
showSummary: [false], //to display summary at end of every group.
grandSummary: true,
fixCols: false,
indent: 20,
collapsed: [true, true, true],
title: [
"{0} ({1})",
"{0} - {1}"
]
};
var obj =
{
width: "auto",
flex: { one: true },
numberCell: { width: 60, show: false },
resizable: true,
filterModel: { on: true, header: false, type: 'local', menuIcon: true, hideRows: false }, //on: true,
menuIcon: true,
selectionModel: { type: 'row', mode: 'block', column: false },
blur: function (evt, ui) {
mGridUIFocus = ui; //global var
mPrevGridUIFocus = ui; //global var
},
editable: false,
stripeRows: false,
showTitle: false,
hwrap: false,
wrap: false,
strNoRows: 'No Net Position found.',
pageModel: { rPP: 50 },
columnTemplate: {
filter: {
crules: [{ condition: 'contain' }]
}
},
colModel: fsTableHeaders,
groupModel: loGroupModel,
rowInit: function (ui)
{
if (ui.rowData.pq_gtitle)
{
//console.log("pq_gtitle: " + ui.rowData);
return {
style: { "background": "#FAD5A5" }
};
}
},
cellSave: function (evt, ui) {
this.refreshRow({ rowIndx: ui.rowIndx });
},
change: function () {
this.filter();
},
beforeCellClick: function (evt, ui)
{
if (this.SelectRow() != null && this.SelectRow().getSelection() != null) {
if (!evt.ctrlKey && this.SelectRow().isSelected(ui) && this.SelectRow().getSelection().length <= 1) {
return false;
}
}
}
};
var loData = "";
obj.dataModel =
{
method: "GET",
location: "remote",
beforeSend: function (jqXHR, settings) {
jqXHR.setRequestHeader("Content-Type", "application/json");
},
getUrl: function () {
return {
url: "URL to Get net postion data",
data: loData
};
},
getData: function (response) {
var loOrderJS = $.parseJSON(response.d);
data = loOrderJS;
return { data: data }
},
error: function (jqXHR, textStatus, errorThrown) {
customalerterror('Error!', jqXHR.responseText, '500px');
}
};
var grid = pq.grid("#gridfilter1", obj);
grid.one('lazyProgress', function () {
this.flex();
});
grid.on("scroll", function (evt, ui) {
mGridUIScrollX = this.scrollX();
mGridUIScrollY = this.scrollY();
mPrevGridUIScrollX = this.scrollX();
mPrevGridUIScrollY = this.scrollY();
});
grid.on("formatCell", function (row, column, value, data)
{
var groupLevel = this.iGroup.getGroupLevel(row);
if (groupLevel !== undefined && this.iGroup.isSummary(row)) {
var color;
switch (groupLevel) {
case 0:
color = "#FF0000";
break;
case 1:
color = "#FF0000";
break;
case 2:
color = "#FF0000";
break;
default:
color = "#FF0000";
break;
}
return {style: "background-color: " + color};
}
});