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. 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.

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

Reply via email to