jqgrid treegrid is defined using code below. First level of data contains only single node displayed in first row in jqgrid. How to make this (treegrid first row) text bold ?
I think you can solve the problem by usage of rowattr
if you want to make the whole row bold (see the answer). You can assign additional class
or style
attribute on the specified row. Alternatively you can use cellattr
to assign class or style only on the cell, for example only on the cell in "menu"
column (see the answer). I used standard grids in the referenced answers, but you can use rowattr
and cellattr
in the same way with TreeGrids. The access to the columns parent
, level
and isLeaf
existing in the TreeGrid can be helpful for you in the implementation.
UPDATED: Here is the demo which mark bold all items which has no parent
:
and another demo use more specific rule:
In both cases I used CSS rule
.ui-jqgrid tr.myMarking td { font-weight: bold; }
The implementation of rowattr
is very simple and can be for example as below
rowattr: function (rd) {
if (rd.parent === "null" && rd.name === "Cash") {
return {"class": "myMarking"};
}
}
#tree-grid .cell-wrapper:first-child
{
font-weight: bold;
}
You just have to skope the 'first-child' of your .css declaration.