3.2.0

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
August 8,
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)
August 8,
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
August 8,
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)
August 8,
It works now.

Thanks for your help.
Gary
August 8,

This topic is archived.

See also:


Back to support forum