Peter Sheldrick schrieb:
Hello Sebastian!

On 3/13/06, *Sebastian Werner* <[EMAIL PROTECTED] <mailto:[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.

I don't know what your application requirements are, but it seems not to be useful to open and directly close the same folder. (In this example this is a problem with the display queue I think. You should do a QxWidget.flushGlobalQueues between them to fix this.)

Normally you want to close or open folder structures on user reactions. I don't think there is any problem with qooxdoo.

I think the best would be, if you explain more detailed what your needs are.

Sebastian

    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
    <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
    _______________________________________________
    Qooxdoo-devel mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
    <https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel>



- Peter
*END OF MESSAGE*



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