:: Forum >>

Loading a CSV

Hello,

Is there a way to load CSV data into grid without using table.setURL? I have the CSV data in a variable.

Thanks for any help!
Gary
Tuesday, August 8, 2006
Didn't check it but hopefully this will work -

var myCSV = "....";
var table = new AW.CSV.Table;
var grid = new AW.UI.Grid;
grid.setCellModel(table);
table.response(myCSV);
...
Alex (ActiveWidgets)
Tuesday, August 8, 2006
The header is displaying ok. Just not the data? Maybe you can see something I'm doing wrong.

var myHeaders = ["Column 1"];
var myCSV = "PSFT";

var table = new AW.CSV.Table;
table.response(myCSV);

var obj = new AW.UI.Grid;
obj.setCellModel(table);
obj.setColumnCount(1);
obj.setHeaderText(myHeaders);
document.write(obj);

Thanks Again!
Gary
Tuesday, August 8, 2006
table.response() updates the grid (clears and sets row count) so it should be called after setCellModel().

var myHeaders = ["Column 1"];
var myCSV = "PSFT";

var table = new AW.CSV.Table;
var obj = new AW.UI.Grid;
obj.setCellModel(table);
table.response(myCSV);

obj.setColumnCount(1);
obj.setHeaderText(myHeaders);
document.write(obj);
Alex (ActiveWidgets)
Tuesday, August 8, 2006
It works now.

Thanks for your help.
Gary
Tuesday, August 8, 2006

This topic is archived.


Back to support forum

Forum search