Hi Derrell,
just now I tried your advise:
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;
}
But there is no skipping.
tree.getDataModel().prune(nodeId, true);
console.log(tree.getDataModel().getData());
tree.getDataModel().setData(null);
console.log(tree.getDataModel().getData());
Because of the null elements of the array, my sortfunction doesn't work
proper. So did I understand you wrong? Is there no way to clear the NULL
elements?
Regards Sak
Von: Derrell Lipman [mailto:derrell.lip...@unwireduniverse.com]
Gesendet: Mittwoch, 29. September 2010 19:42
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] virtual tree pune sets NULL, but setData dont
accepts NULL in nodeArray
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
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel