Jqgrid substring extension

I have a jqgrid that has a subgrid. How can I expand the subtitle without clicking on the plus sign?

I came across $("#jqgrid_id").expandSubGridRow(rowId); but not sure which rowId to use to expand the subtitle.

Thanks.

+7
jquery jqgrid subgrid
source share
2 answers

Use $("#jqgrid_id").expandSubGridRow(rowId); in the onSelectRow event of the grid.

Something like that:

 jQuery("#jqgrid_id").jqGrid({ ... onSelectRow: function(rowId){ $("#jqgrid_id").expandSubGridRow(rowId); }, ... }); 

EDITED: GridComplete Event

 jQuery("#jqgrid_id").jqGrid({ ... gridComplete: function(){ var rowIds = $("#jqgrid_id").getDataIDs(); $.each(rowIds, function (index, rowId) { $("#jqgrid_id").expandSubGridRow(rowId); }); }, ... }); 
+11
source share

Change getDataIds () to getDataIDs ()!

+1
source share

All Articles