Hi there,
I'm a qooxdoo newbie and need some help.
I try to fill a table with json data. This is my sourcecode:
var doc = this.getRoot();
var tableModel = new qx.ui.table.model.Simple();
tableModel.setColumns([ "Jahr", "Wert" ]);
var url = "https://localhost:4711/rest/tabelle";
var jsonStore = new qx.data.store.Json(url);
jsonStore.addListener("loaded", function(e){
alert(e.getData());
var data = e.getData();
var test = new qx.data.Array();
alert data.length; // = 4
alert(qx.lang.Object.getValues(data["Jahr"])); // = nothing
//tableModel.setData(tableData);
//tableModel.setData(data);
});
var table = new qx.ui.table.Table(tableModel);
doc.add(table);
How can I write the data into the Array test? Is this necessary to fill the
table with data? How can I access to a single field of the data array?
The output of "alert(e.getData()) is the following string:
"Jahr,Wert,1999,34.4,2000,45,2001,199"
If I type the url to a browser I get a textfile with the following content:
[["Jahr","Wert"],[1999,34.4],[2000,45.0],[2001,199.0]]
In another thread I read something like this, but I don't understand how I
can use this:
qx.lang.Object.getValues(data);
I would be thankful if someone could help me.
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/json-data-into-table-tp6036150p6036150.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel