<script>
var table = new Active.XML.Table;
table.setURL("companies-simple.xml");
table.request();
var obj = new Active.Controls.Grid;
obj.setModel("data", table);
document.write(obj);
<script>
function AddRow()
{
var dataXmlDoc = obj.getDataProperty('XML');
var rootNode = dataXmlDoc.documentElement;
var newRow = dataXmlDoc.createElement( "company" );
var colName = dataXmlDoc.createElement( "ticker" );
newRow.appendChild(colName);
var colName = dataXmlDoc.createElement( "name" );
newRow.appendChild(colName);
var colName = dataXmlDoc.createElement( "mktcap" );
newRow.appendChild(colName);
var colName = dataXmlDoc.createElement( "sales" );
newRow.appendChild(colName);
var colName = dataXmlDoc.createElement( "employees" );
newRow.appendChild(colName);
rootNode.appendChild(newRow);
obj.setRowProperty("count", rootNode.childNodes.length);
obj.refresh();
}
This topic is archived.