Hi, - make your backend return just data, not the column headers
- then use tableModel.setData(data) - read the API at http://demo.qooxdoo.org/1.3.x/apiviewer/#qx.ui.table.model.Simple for info on accessing the table rows/cells, etc Cheers, Fritz On Thu, 17 Feb 2011, chrjab wrote: > > 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. > > -- Oetiker+Partner AG tel: +41 62 775 9903 (direct) Fritz Zaucker +41 62 775 9900 (switch board) Aarweg 15 +41 79 675 0630 (mobile) CH-4600 Olten fax: +41 62 775 9905 Schweiz web: www.oetiker.ch ------------------------------------------------------------------------------ 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
