PDA

View Full Version : Tree Node: expandable/leaf doesn't seem to work



walnutmon
8 Dec 2009, 9:36 AM
All,

I've seen this problem discussed on the forum, but strangely none of them have actually come up with a reasonable fix for this issue

Basically the problem is that an empty node always has a folder with a plus sign next to it, even with an empty child list, if you force the node to expand itself so that it discovers the fact that there are no children, it actually renders as a leaf

solutions generally just change the leaf icon to a folder, but this is no good, since I still have uses for leaves, and an empty folder is not the same as a leaf node, it's an empty folder, which shouldn't be able to be expanded, I have tried every single possible combination of the properties expanded, expandable, leaf and children and they all create unwanted results

All I want is an empty folder to look like a folder, with no plus sign, is there something i'm doing wrong fundamentally because based on the API what I'm doing should work, perhaps there is a bug that has been fixed already?

thanks guys!

CrazyEnigma
8 Dec 2009, 7:55 PM
Are you checking your folder location for whether or not there is a folder that is empty, then you can specify:


leaf: true

in the return.

But this solves the only the plus icon. You could specify:


iconCls: ...

to maintain the icon, but then you would have to manage the icon classes in css.

Not too sure if this gets you any further.

walnutmon
9 Dec 2009, 5:04 AM
Yeah, that has been the general consensus from reading the forums, but like I said, I still want to have the ability to have leaf nodes with the leaf icon

Perhaps there is a way to extend the Tree so that it doesn't render the plus sign next to empty folders?