jquerystruts2jqgridstruts2-jquerystruts2-jquery-grid

Struts 2 jquery plugin grid (jqGrid) with groupField and rownumbers


I have set an sj:grid to have rownumbers and grouped a column with groupField as:

<sjg:grid rownumbers="true" groupField="['subTypeDesc']" 
          groupSummary="[true]" groupColumnShow="[false]"
          groupMinusIcon="ui-icon-circle-minus"
          groupPlusIcon="ui-icon-circle-plus" ..... >

The rows are grouped but the row numbers are not displayed for rows any more. Any comments ?!

As the sjg is totally based on jqGrid may be some jqGrid trick can help but I could not find any thing ?!


Solution

  • The option rownumbers: true can't be used (it will be ignored) in case of combination with some other options like grouping (see the limitations) and TreeGrid.

    The reason of such restriction will be clear after understanding of the implementation details. The collapsed groups (and tree nodes/leafs) still exist in the grid, but there are hidden. In opposite to data grouping (grouping: true) TreeGrid don't prevent the usage of rownumbers: true, the usage looks not really helpful.

    Look at the rownumbers column on the demo, which displays the results like on the picture below:

    enter image description here

    The row numbers corresponds all currently loaded nodes and leafs, even collapsed. Such look of the grid is misunderstanding for the user. Because of that the option rownumbers: true will be explicitly changed to rownumbers: false during initializing phase of data grouping.