Two grids per page with xml data
I'm trying to implement a double grid in one page taking the data from XML tags and I can't find the way to do it. When I do the "document.write(obj1)" for the first grid the execution of the script scapes and don't print the rest of the html file.
Any Ideas?
Marc Font
July 18,
More info: here you have a sample code which doesn't work
// create ActiveWidgets data model - XML-based table
var table = new Active.XML.Table;
// get reference to the xml data island node
var xml, node = document.getElementById("xmlData");
// IE
if (window.ActiveXObject) {
xml = node;
}
// Mozilla
else {
xml = document.implementation.createDocument("","", null);
xml.appendChild(node.selectSingleNode("*"));
}
// provide data XML
table.setXML(xml);
// define column labels
var columns = ["Codi", "Nombre de Ramals", "Cà rrega (Kg)", "Velocitat d'elevació (m/min)", "ISO", "Alçada d'elevació (mm)", "Pèrdua d'alçada (mm)", "Preu (\u20AC)"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
obj.setId("grid1");
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(table);
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
obj2.setId("grid2");
// provide column labels
obj2.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj2.setDataModel(table);
// write grid html to the page
document.write(obj+obj2);
Of course xmlData is well defined and previous sample code works replacing the last line to "document.write(obj);"
Any Ideas?
Marc Font
July 18,