Lets look how to load simple XML data into the grid.
Here is the XML:
To load and transform XML data you need an XML table model.
var table = new Active.XML.Table;
Assign a URL of the XML file.
table.setProperty("URL", "simple.xml");
By default the model looks at the documentElement as the data root. Then all child elements of the root are treated as rows and the child elements of each row node become the table cells. Exactly as this simple example looks like.
Just load the file.
table.request();
After the grid object is created
var obj = new Active.Controls.Grid; obj.setProperty("column/count", 5);
it is assigned our new external data model.
obj.setModel("data", table);
Don't forget to write the grid HTML to the page as usual.
document.write(obj);
Full script: