If you want you can set the column names automatically too - qx.lang.Object.getKeys(obj) turns the keys of obj into an array. For example going off my previous code :
console.log(qx.lang.Object.getKeys(test[0])); => ["col1", "col2", "col3"] and you can use this to set the columns in your model: mytablemodel.setColumns(qx.lang.Object.getKeys(data[0]); Also I think you need to do mytablemodel.setColumns(...) *before* you do mytablemodel.setData(...). -deech On Sat, Dec 4, 2010 at 10:47 PM, aditya siram <[email protected]> wrote: > I think that qx.lang.core automatically adds a Javascript > implementation of forEach if there isn't a native one. > > It's hard to tell from looking at your error message, but it looks > like you may have missed a column. > > -deech > > On Sat, Dec 4, 2010 at 8:32 PM, Marco Pompili <[email protected]> wrote: >> >> Thank you for your suggestions. I'm following aditya's method so I don't need >> to know what the column's name are. >> >> I've set up this code: >> >> var data = response.getContent(); >> var rows = new Array(); >> >> var addRow = function (obj) { >> rows.push(qx.lang.Object.getValues(obj)); >> }; >> >> data.forEach( addRow, data ); >> tableDM.setData( rows ); >> >> This works perfectly >> >> Now a strange thing is that if I use the qooxdoo Array object: >> >> var rows = new qx.data.Array(); >> >> The code doesn't works and Firebug gives me this error message; >> >> this.__pl[bN] is undefined >> }return this.__pl[bN][bM]; >> >> I don't get it... >> -- >> View this message in context: >> http://qooxdoo.678.n2.nabble.com/Json-and-Table-models-tp5803644p5804345.html >> Sent from the qooxdoo mailing list archive at Nabble.com. >> >> ------------------------------------------------------------------------------ >> What happens now with your Lotus Notes apps - do you make another costly >> upgrade, or settle for being marooned without product support? Time to move >> off Lotus Notes and onto the cloud with Force.com, apps are easier to build, >> use, and manage than apps on traditional platforms. Sign up for the Lotus >> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d >> _______________________________________________ >> qooxdoo-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel >> > ------------------------------------------------------------------------------ What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
