Hey,
> You're right of course!
>
> I didn't think of using bindItem, but it's indeed the way to do this.
> Took me a little time to realize that I also needed to call
> bindDefaultProperties (turned out to be a case of RTFM ;) ), but it
> works like a charm now:
>
> {
> bindItem : function(controller, item, id) {
> controller.bindDefaultProperties(item, item.getModel());
>
> controller.bindProperty("someProperty", "contextMenu", {
> converter: function(value) {
> return value ? someContextMenu : null;
> }
> }
> }, item, id);
> }
Good to hear that its working. :) Thats the way it was designed.
>
> It's also much better since even the contextMenu can now change
> dynamically based on the "some" property. The power of data binding is
> amazing. :)
And I hope you can find out even more of the power of it. ;)
> By the way. I noticed that the API doc of bindDefaultProperties() says
> the first argument should be a TreeFolder. Shouldn't that be an
> AbstractTreeItem instead?
You are right. Changed it right away! (r27106)
Thanks,
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