SMART datagrid v.1 > Classes > TreeDataSet
It creates XMLList object or XML string which contains properties corresponding to data set fields and can contain the array of child objects as the property specified by childRowsProp as tree data rows, removes existing rows and adds them.
In the table below, it has listed the way of reading rowsProp which specifies the location of XML node which will be used as data rows and childRowsProp which specifies the location of XML node which will be used as child rows.
var rows
= "<rows>"
+ "<row>"
+ "<icon>0</icon><loan_number>IBRD00010</loan_number><country>Spain</country>"
+ "<children>"
+ "<row>"
+ "<icon>1</icon><loan_number>IBRD00030</loan_number><country>Denmark</country>"
+ "</row>"
+ "<row>"
+ "<icon>2</icon><loan_number>IBRD00040</loan_number><country>Luxembourg</country>"
+ "</row>"
+ "</children>"
+ "<row>"
+ ...
+ "</rows>";
ds.setXmlRows(rows, "row", "children", false);
path | Explanation |
---|---|
'' | If do not specify or it is an empty string, it cannot be read as data rows. If do not specify, it will get elements of which name is 'row'. |
'row' | It reads the ones of which name is 'row' among top elements as row. |
'prop.row' | It reads the ones of which name is 'row' among child elements of the first element among top elements of which name is 'prop' as row. It is the same as specifying as 'prop[0].row'. |
'prop[1].row' | It reads the ones of which name is 'row' among child elements of the second element among top elements of which name is 'prop' as row. |
'$[0].row' | The original data is an array, and it reads 'row' property of this first object as array. |