ParamQuery grid support forum
General Category => Bug Report => Topic started by: jplevene on July 13, 2026, 08:32:51 pm
-
When I set a column filter below I get an error that "data" is undefined in cTree.prototype in functions groupById: function(data) and clearFolderCheckbox: function(data)
{
"crules": [
{
"condition": "range",
"value": []
}
],
"cls": "pq-grid-hd-search-field-drop-down",
"options": [
{
"STATUS": 0,
"NAME": "Draft"
},
{
"STATUS": 1,
"NAME": "Awaiting approval"
},
{
"STATUS": 2,
"NAME": "Approved"
},
{
"STATUS": 3,
"NAME": "Confirmed"
},
{
"STATUS": 4,
"NAME": "Part received"
},
{
"STATUS": 5,
"NAME": "Received"
},
{
"STATUS": 6,
"NAME": "Part returned"
},
{
"STATUS": 7,
"NAME": "Returned"
},
{
"STATUS": 8,
"NAME": "Cancelled"
}
],
"gridOptions": {
"stripeRows": false,
"numberCell": {
"show": false
},
"filterModel": {
"header": false
},
"focusModel": {
"focusable": false,
"onTab": ""
},
"selectionModel": {
"type": null,
"column": false
},
"height": 245
}
}
FIXES:
groupById: function(data) {
var self = this,
id = self.id,
pId, parentId = self.parentId,
groups = {},
group, data2 = [],
i = 0,
len = data ? data.length : 0, // <--- HERE
rd;
for (; i < len; i++) {
rd = data[i];
pId = rd[parentId];
pId == null && (pId = "");
if (!(group = groups[pId])) {
group = groups[pId] = []
}
group.push(rd)
}
self._groupById(data2, id, groups[""] || [], groups, 0);
return data2
},
...
clearFolderCheckbox: function(data) {
if(data) // <-- ADDED if
{
var self = this,
cbId = self.cbId;
data.forEach(function(node) {
if (self.isFolder(node)) {
delete node[cbId]
}
});
}
},