On Thu, Dec 29, 2011 at 12:42, Scott Chapman <[email protected]> wrote:
> Thanks for the help. I did:
>
> console.log(e.getData())
> then:
> __tableModel.setData(e.getData());
>
> The log shows "Please use toArray() to see the content" ....
>
> The setData gave me an error in the console.log:
>
> this.__rowArr[rowIndex] is undefined
> return this.__rowArr[rowIndex][columnIndex];
>
> It would be very nice if the producers and consumers of data in this
> framework were compatible without this fiddling!
>
The problem is that you're mixing the nice new data binding stuff with the
antique Table widget. The Table widget is wonderful, and there's not yet a
data binding-version of it, so you need to do a bit of fiddling to get the
two to work together.
Data binding uses a class called qx.data.Array for its results. The reason
is that it's all based on property value changes, so each element of a
model must be a property. What you get back from your Rest method, then, is
apparently a qx.data.Array value, not a native array.
The Table widget predates (by many, many years), the advent of
qx.data.Array and data binding. It accepts, as its model (for
qx.ui.table.model.Simple), a native array.
The method toArray() of the qx.data.Array class converts the model stored
in the qx.data.Array instance into a native array.
So in fact, you just need to do what it's saying, which is to call the
toArray() method on that qx.data.Array object you're getting in the event
data, and pass that to tableModel.setData().
Don't worry. There are plans for a data binding implementation of a Table.
It just hasn't been done yet.
Cheers,
Derrell
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel