Is there any way to target a column in a jqGrid (in my case, Struts2-jQuery-Grid Plugin 3.7.0) on certain rows only ?
For example, I want to show the content of the 2nd column only if the 1th column value is Movie:
_______________________________________________________
| COL 1 | COL 2 |
|===================|===================================|
| Movie | bla bla yada yada |
|-------------------|-----------------------------------|
| Song | |
|-------------------|-----------------------------------|
| Clip | |
|-------------------|-----------------------------------|
| Movie | foo or bar that is the question...|
|-------------------|-----------------------------------|
| Game | |
|___________________|___________________________________|
I've tried to use conditional OGNL expressions in hidden
and cssClass
fields of the GridColumnTag, but immediately noticed they evaluate once against the whole column, not at every "iteration".
As a workaround, I can manually hide the columns in that rows with javascript after the grid is populated, but that is a hack, and I'm wondering if there is a clean solution to conditionally "do something" on a columns per-row.
NOTE: I can't simply erase the content from the source List
(as it would be obvious) because COL 2 in my real case is a Boolean
, represented as checkbox
.