Hello Benoît,
I have to admit that I don't get your use case right. You want to use
"model.tree" on the first load as model for the tree controller and on
the second load, you want to use "model.tree.kids"? Do you want to set
the selection with the second bind? :
> this.store.bind('model.tree.kids', this.tree.controller,
> 'selection[0].kids')); // this would'nt work
Because thats what the code tries to do.
Perhaps you could tell me what you want to achieve with the code?
Maybe i can help you more if I know what you want to do.
To your second question: You can just change the model and the data
binding will populate the the tree. As the model is a set of qooxdoo
objects with data arrays, you can just manipulate these model objects
and that should do the job. :)
Best,
Martin
Am 24.07.2009 um 16:08 schrieb benco:
>
> Hello,
>
> I'm a bit stuck and I really need some help here.
>
> I'm working on a Tree that can be loaded progressively on deploy and
> selection events. I also would like using the new binding features
> with that
> tree (namely the Tree Controller and the Json Store).
>
> The problem is I don't know how to manage the bindings correctly.
>
> In the first step (first launch), I bind the store with the tree
> controller.
> Then, the behaviour changes. The store should be binded to the tree
> controller "selection[0]". I really don't know how to do this in a
> simple
> way.
>
> If it's not possible ... never mind (I'll use the default tree
> behaviours
> and functions). But It would be useful and cool.
>
> Here's a code example:
>
> this.tree.controller = new qx.data.controller.Tree(null,
> this.browser.tree,
> "kids", "name");
>
> this.store = new qx.data.store.Json();
>
> this.tree.bindId =
> store.bind('model.tree',this.tree.controller,'model');
>
> this.store.addListener("loaded", function(ev)
> {
> // first loading
> if (this.tree.bindId)
> {
> this.store.removeBinding(this.tree.bindId);
> this.tree.bindId=null;
>
> var root = this.tree.getRoot();
> if (root)
> {
> this.tree.addToSelection(root);
> root.setOpen(true);
> }
> }
> else
> {
> this.store.bind('model.tree.kids',this.tree.controller,
> 'selection[0].kids')); // this would'nt work
> }
> }, this.browser);
>
> Furthermore, I'd like to know how I can complete/populate a partial
> zone of
> a model in the tree controller by new additional datas without
> resetting it
> completely... Any Ideas ?
>
> Thanks in advance,
>
> Best,
>
> Benoît.
> --
> View this message in context:
> http://www.nabble.com/Progressive-Tree-on-selection-and-or-deployement-%2B-the-new-binding-features-tp24645160p24645160.html
> Sent from the qooxdoo-devel mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel