Thank you, Fabian

I end up with this code that does exctly that:

var element = e.getTarget();
while (!(element instanceof qx.ui.tree.TreeFolder))
       element = element.getLayoutParent();

Any disadvantage of doing this way?

What if .getTarget could receive a argument saying what kind of object we
are expecting:

e.getTarget() -> returns the widget below the mouse cursor as it is now

e.getTarget(qx.ui.tree.AbstractTreeItem) -> returns the first object that is
an instance of "qx.ui.tree.TreeFolder" when walking up the widget hierarchy


2008/8/7 Fabian Jakobs <[EMAIL PROTECTED]>

> Guilherme Aiolfi schrieb:
> > ops, now I saw that setUserData has 2 args
> > sorry for that :$
> >
> > but can I get the Tree Item using the "dblclick" event in the Tree?
>
> If you are using 0.8 you can try the following code:
>
> tree.addListener("dblclick", function(e) {
>    var item = tree.getTreeItem(e.getTarget());
> }, this);
>
>
> The event target is the widget immediately below the mouse cursor. What
> "getTreeItem" does is walking up the widget hierarchy starting from the
> given widget until it finds a tree item and returns it.
>
> Best Fabian
>
> --
> Fabian Jakobs
> JavaScript Framework Developer
>
> 1&1 Internet AG
> Brauerstraße 48
> 76135 Karlsruhe
>
> Amtsgericht Montabaur HRB 6484
>
> Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas
> Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Oliver Mauss,
> Achim Weiss
> Aufsichtsratsvorsitzender: Michael Scheeren
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to