ParamQuery grid support forum
General Category => Suggest new features => Topic started by: jplevene on July 14, 2026, 04:25:37 am
-
Would like to be able to have a treeModel setting that hides the open/close branch icon when "children" of a node is empty. At the moment, the only way to do this is to delete/ommit children, which can be slow as I need to loop through the rows. Also I might drag or delete the only child row out of a parent, yet the parent still has an expand option.
My current fix/hack is in render:
if(ui.rowData["children"] && ui.rowData["children"].length==0)
{
delete ui.rowData["children"];
// Queue a micro-task to instantly redraw the row as a leaf (removes the arrow natively)
var grid = this;
setTimeout(function(){ grid.refreshRow({ rowIndx: ui.rowIndx }); }, 1);
}
BUG:
Also if you look at the first "case 0". In normal render, the "attr" value can be a string or an object, in this render it can only be a string
icons: true,
render: function(ui){
switch (ui.rowData["TYPE"]) {
case 0: return {iconCls:"ui-icon-folder-open", attr:{title:"Not working"} }; break; // <--- attr can't be an object here
case 1: return {iconCls:"ui-icon-cart-b", attr:"title='This works'"}; break;
case 2: return {iconCls:"ui-icon-gear"}; break;
case 3: return {iconCls:"ui-icon-radio-off"}; break;
.....
}
},