Hi,
I have an xTreeGrid with the first column set as type “tree”. Loading from XML I create a 3 tier tree in this first column by specifying rows within rows inthe XML definition. How do I use the addRow function to add a new row to the grid but still preserve the tree structure in the first column?
e.g. Say I’m loading a very basic:
LEVEL1
< />
LEVEL2
< />
Hello< />
So LEVEL1 will be expandable to have LEVEL2 below it, and LEVEL2 will be expandable with Hello in the 2nd column - how can I use an addRow() call to maintain this LEVEL1/LEVEL2 tree and have another row with a value in the 2nd column?
Thanks!
In case of treeGrid addRow command can have 3 additional parameters
- parent id
- image
- child flag ( used in dynamical loading only )
grid.addRow(new_id,[" top level row “,” second column value"],null,0); //adding row on top level
grid.addRow(new_id2,[" child row “,” second column value"],null,new_id); //adding row as child of new row
grid.addRow(new_id3,[" child row “,” second column value"],null,‘level2.1’); //adding row as child of existing row