Hello Sebastian!

On 3/13/06, Sebastian Werner <[EMAIL PROTECTED]> wrote:
Peter Sheldrick schrieb:
> I'm mapping a file tree to a QxTree. But i find myself wanting to create
> my own Tree object and using it and the QxTree in tandem to do what i
> want. This is because for every tree node i want to save the filename,
> path and children. Or sometimes i want to change the apperance of a
> specific node. Also when i just collapse a QxTree it only works if i
> save all the nodes in a seperate array and collapse them all reversed -
> like this:
>
> function collapse(nodes) {
>   for (var i=1; i <= nodes.length; i++)
>     nodes[nodes.length - i].setOpen(false);
> }
>
> otherwise i get display errors.
>
> But this is all ugly. So to sum it up: Is there an elegant way to
> collapse a QxTree and save extra information for every node?

First, why not just use the open and close methods of each folder
instance.

What i don't like about the open and close methods is that they don't work properly. Just put the code

te1.open();
te1.close();

at the end of the _javascript_ code in "Tree_1.html". The folder "Desktop" opens - but doesn't close again.
 
Second, you can save any information you like to an _javascript_
instance. Just do something like:

myTreeFolder._someInfo = "foo";

Also there is a nice qooxdoo interface for this type of data:

myTreeFolder.setUserData("someInfo", "foo");
alert(myTreeFolder.getUserData ("someInfo"));

Hope this helps.

This bit helped - its appreciated.

Sebastian

>
> - Peter



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


- Peter
*END OF MESSAGE*

Reply via email to