Hey,
> Following a similar example to the Twitter application I have a property
> "fetchedData" in my class that stores a list obtained from a jsonp store. I
> bind the store model to this property so the contents of the store are
> available in that property.
>
> I also have two drag and drop lists and I created a ListController for one
> of the lists like so:
> var controller = new qx.data.controller.List(null, firstList);
>
> Then I bind the property to the list:
> this.bind("fetchedData", listController, "model");
>
> However I don't understand how the previous line works since I created the
> controller without a model, but I assume the framework creates the model
> when I bind the fetchedData property to the list.
The store is responsible for loading the data and creating a model. The
reference to model loaded with the store is just copied to the controller so he
can access it as soon as its available. Thats all the first line does.
> I am listening to the "changeModel" event of the listController but it is
> called only when the list is initially populated. When I drag and drop
> items between the lists it is not called.
Well, the changeModel event is fired when the property called model has been
changed. As you did not change the model property, in best case only the
content of the mode, you won't get the changeModel event.
> How can I guarantee that the model for the list is being updated? (I also
> want to create a controller for the second list so I have a model for it
> too).
That really depends on your drag & drop implementation. There is no pre build
implementation in the framework which is exactly doing what you are trying to
do. But here are my ideas how to solve that:
- create controller for both lists
- initialize the first with the model from the store
- initialize the second with an empty data array
- on drop:
- I guess you get the widget you try to move so use the getModel method to
get your model item.
- remove that model item from the current model (models are arrays in that
case so use the usual array methods)
- Add the model item to the second list
I hope that gives you an idea how to get that done.
Best,
Martin
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel