On Tue, Sep 28, 2010 at 16:10, <i...@saksys.de> wrote:

> Hi List,
>
> i wrote a little function to sort leafs (branch children). So I just clone
> all nodes one by one. If branch has children leafs, just reorder the
> children array of the branch and set it in return.
>
> That was very effective. But after using prune, NULL stands for deleted
> nodes. But if I set that array with NULL elements (using .setData()), I
> got an error: nodeArr[i] is null at function setData -> render()
>
> So is this a bug or is their a nice way to get the NULLs rid of my tree?
>

There is no way to get rid of the NULLs, and in fact, you don't want to get
rid of them. They must remain there because otherwise the indexes into the
array get messed up, and those indexes are the values returned by the
various tree functions to reference a particular node and that reference the
children of a node.

You indicated that you passed the modified array. That is incorrect. You do
not pass the altered array to setData(). Instead, you simply call
setData(NULL). When it renders the data, it skips nodes that are null:

            // Skip deleted nodes
            if (child == null)
            {
              continue;
            }

Derrell
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to