0

Can anyone point to multiple subgrid at the same level demo or example . I have already looked at http://www.trirand.net/demoaspnet.aspx. I'm looking for something in javascript.

Pdadev
  • 47
  • 2
  • 6
  • 1
    Sorry, but it's not clear what you mean. All examples of subgrid create subgrids on the top level. What you mean? – Oleg Feb 27 '13 at 16:20
  • 1
    I'm looking for loading 2 subgrid at the same level from the main grid. – Pdadev Feb 27 '13 at 16:26
  • To clarify more I'm looking for something like http://www.trirand.net/demoaspnet.aspx. --->Hierarchy--->multiple subgrid at the same level. – Pdadev Feb 27 '13 at 16:41

1 Answers1

3

The demo from the trirand.net shows just the following

enter image description here

It's very easy to create the subgrids like on above picture. You should just understand how the technique Subgrid as Grid works.

If the user click on "Expand" ("+") icon jqGrid create empty new row below of the expanding. The row (<tr>) will get the class "ui-subgrid". Inside of the row jqGrid create two <td> elements one td.subgrid-cell and another td.subgrid-data with the main subgrid information. jqGrid assign colspan so that the <td> will be extended till the last column of the grid. Inside of the td.subgrid-data jqGrid create empty div.tablediv. The empty div get unique id attribute which will be constructed from the id of the grid id, the character "_" and id of expanding row.

The next step is the mostly important. jqGrid call subGridRowExpanded callback. The first parameter of the callback is the id of empty <div> (the div.tablediv) where "subgrid" content should be placed. Instead of <table> element one can place any other HTML fragmant . See the old demo from the answer. So to create "multiple subgrid at the same level" one need just place two <table> element with some unique ids and use jqGrid to create grids on place of the tables.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • The Demo link has a server error... – IlludiumPu36 Jun 06 '17 at 03:12
  • @IlludiumPu36: I'm not owner of www.trirand.net and I can't fix the link, but the picture contains all what one need to know. [The demo](http://www.ok-soft-gmbh.com/jqGrid/SubGrid.htm) referenced at the end of my answer provide all what one need to know. jqGrid create empty `
    ` where *any* "subgrid" information could be displayed. See [the answer](https://stackoverflow.com/a/27487764/315935) for additional information.
    – Oleg Jun 06 '17 at 06:04