ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Parent and child rows in ng-grid

Open getjewelfast115 opened this issue 12 years ago • 7 comments

Hi, I would like to know whether Is it possible to create child rows under a parent row in ng-grid?. For example: Suppose if I have a number rows in ng-grid where each row with attributes of a school, and when I select a single row in it, it will display a number of rows below to it with each row giving details of children under that school. Any help is appreciated.

getjewelfast115 avatar Feb 06 '14 21:02 getjewelfast115

It might can be done with a custom row template, but I think you would have a lot of issues with it even if you could pull it off. Scrolling probably depends on all row heights being the same.

Child grids and multiple height rows are something we are considering for 3.0

swalters avatar Feb 06 '14 22:02 swalters

I would tackle this by putting the "sub view" (which is what the child row is, I guess) outside the grid. Like in a pane beneath it. Then either use the row selection event or a custom row template with a "View" button and then populate the pane with the row's data on select or click.

c0bra avatar Feb 06 '14 22:02 c0bra

we had a similar requirement. we had added a pane below the grid and show/hide the pane on mouse hover on the cell...Even you can add another grid to the pane as it is not nested inside the first one...

theluckin avatar Feb 09 '14 01:02 theluckin

@theluckin, Even we ad same requirement, can you show us a bit of way of handling this. how you did it

regards

gavy81 avatar Feb 12 '14 08:02 gavy81

@theluckin Can you please share the code snippet or plunker

Regards.

mdnaushadkhan avatar Feb 12 '14 09:02 mdnaushadkhan

Sure thing, will share a plunker soon...

theluckin avatar Feb 13 '14 07:02 theluckin

http://jsfiddle.net/champakkc/FWC34/

theluckin avatar Feb 14 '14 23:02 theluckin