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!
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);
...
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!
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);
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.
Thanks for your help.
Gary
August 8,
This topic is archived.
See also:
HELP!!! CSV tbl.request fails on host
Alex from Sydney
(9)
loading data from CSV into Grid
Scott
(4)
How to avoid loading aw.js at each page
thierry
(8)
How to load data into grid from CSV
Sir Frustrated
(3)
Help getting new row data for csv write.
Justin (Boston)
(6)
Grid load time
Stuart
(6)
Slow Load from Javascript
Brian Crandall
(5)
Thai Language incorrect present when load from CSV file to data-grid
Nuttapon Tharachaikul
(2)
Back to support forum