SMART datagrid v.1 > Classes > TreeDataSet
It creates data rows from the array of arrays which contain tree information and have been sorted in data set field order and adds them to the end of parent row specified by parent.
In order to insert in the middle location, it will use insertDataRows. Please refer to setRows about the way of organizing the tree by using parameters.
// It is the same as below call.
ds.insertDataRows(parent, parent.count(), rows, treeField, useTreeField, needSorting);
var rows = [
[0, "1","IBRD00010","France","4.25","USD","P037383","250","000","001.00","11/01/1952","05/01/1977"],
[1, "1.1","IBRD00020","Netherlands","4.25","USD","P037452","191","044","211.75","04/01/1952","10/01/1972"],
[1, "1.2","IBRD00021","Netherlands","4.25","USD","P037452","3","955","788.25","04/01/1953","04/01/1954"],
[2, "1.2.1","IBRD00030","Denmark","4.25","USD","P037362","40","000","000.00","02/01/1953","08/01/1972"],
[3, "1.2.2","IBRD00040","Luxembourg","4.25","USD","P037451","12","000","000.00","07/15/1949","07/15/1972"]
];
var p = treeMain.focusedDataRow();
if (p) {
// Do not use treeField and no need to sort since it has already been sorted.
dsMain.appendDataRows(p, rows, 1, false, false);
treeMain.expand(treeMain.focusedRow());
var row = row.getChild(p.count() - 1);
row = treeMain.getRowOfDataRow(row);
treeMain.expand(row, true);
treeMain.setFocusedRow(row);
}