3.2.0

xml table as variable

Probably something simple but,

I am trying to attach a xml table to a grid, it makes it easier to work with the grid in a iFrame popup window. It all works correctly until I add more than one grid on the page.

The second grids TABLE object seems to overwrite the first grids TABLE that was created. Here is the subclassed grid:

AW.UI.XMLGrid = AW.UI.Grid.subclass();
AW.UI.XMLGrid.create = function()
{
var obj = this.prototype;
obj.Columns = ["",""];
obj.Table = new AW.XML.Table;

obj.Table.setColumns(["ORIG","COL_COLOR"]);
obj.setHeaderText(obj.Columns);
obj.setCurrentRow(-1);
obj.setSelectionMode("single-row");
obj.setVirtualMode(false);
obj.Table.response("");
obj.setCellModel(obj.Table);
obj.setRowCount(obj.Table.getCount());

obj.defineRowProperty("Mybackcolor", function(row){return this.getCellValue(1, row)});
}

On my screen if I add

var G1 = new AW.UI.XMLGrid;
G1.setId("G1");
...
G1.Table.response(unescape("_G1Data_"));
G1.setCellModel(G1.Table);
G1.setRowCount(G1.Table.getCount());
document.write(G1);

var G2 = new AW.UI.XMLGrid;
G2.setId("G2");
...
G2.Table.response(unescape("_G2Data_"));
G2.setCellModel(G2.Table);
G2.setRowCount(G2.Table.getCount());
document.write(G2);

Both grids are displayed but G1 has the DATA from G2?

Any help on this appreciated.

Thanks,
Erik Dobrie
March 17,

This topic is archived.

See also:


Back to support forum