Search code examples
javascriptjquerydatagridjqgridnested

Knowing the level of grid nesting in JQGrid


I'm using JQGrid 4.0. In order to use a different CSS for the different level of nesting at the point where the column headers are generated, which is in my point at line 2039 of jquery.jqGrid.src.js.

thead += "<th id='"+ts.p.id+"_"+ts.p.colModel[i].name+"' role='columnheader' class='ui-state-default ui-th-column ui-th-"+dir+"'"+ tooltip+">";

I tried to look at the different variables and objects in the scope at runtime using Chrome development tools, but to no avail.

In my context, JQGrid is embedded in an enterprise framework and cannot easily be upgraded to a newer version. Otherwise, I would upgrade to Free-JQGrid.

Can it be done?


Solution

  • If you are following the Subgrid as grid concept the sub-grids are created manually by you. So for each subgrd you can add an attribute indicating the level and when expanding for a new sub-level you can access this attribute from the parent.