Specifies the XPath expression for the table columns (cells).
The default columns XPath is "*" - selecting all child nodes under the row node. Use setColumns(xpath)
or setColumns([xp1, xp2 ...])
to specify different location or subset of the cell nodes. It is possible to use expressions for the attributes ("@name"), elements ("name") or any other valid xpath. The xpath is evaluated relative to the row node.
var value = obj.getColumns();
obj.setColumns(value);
The following example displays column data using child elements, row attribute (@id) and child node attribute (price/@ccy).
<xml id="data">
<orders>
<order id="101">
<product>RedWidget</product>
<price ccy="USD">456.00</price>
<qty>10</qty>
</order>
<order id="102">
<product>BlueWidget</product>
<price ccy="GBP">123.00</price>
<qty>1</qty>
</order>
</orders>
</xml>
<script>
var table = new AW.XML.Table;
table.setColumns(["@id", "product", "price", "price/@ccy", "qty"]);
table.setXML(document.getElementById("data"));
var obj = new AW.UI.Grid;
obj.setCellModel(table);
obj.setColumnCount(5);
obj.setRowCount(2);
document.write(obj);
</script>
Set table, rows XPath, namespace property