Hi again,
as always - donations are not required but encouraged ;) I always try
to help - donation or not :)
As for the delete problem - that is fixed on my working copy, but
still - thanks for noticing.
As for deselecting, I guess you could process the click event in the
document. Then check:
if($(event.target).parents('.tree:eq(0)').size() == 0) {
jQuery.each(t.selected_arr, function(i, val) {
t.deselect_branch(val);
})
}
I have not really tested this, but it should work - also - replace t
with a tree reference - you can get one using $.tree.reference or
$.tree.focused.
This will make clicking outside the tree container or the container
itself (but not the UL) deselect all.
Kindest regards,
Ivan
On 21 Окт, 01:49, Brendon Muir <
bren...@spikeinsights.co.nz> wrote:
> That's correct, but I only want to have one "add a new item" button and want
> it to either add it to the currently selected parent or if nothing is
> selected to add it to the root. Because you can't easily unselect everything
> in an intuitive way (i.e. click somewhere other than on an item (like in
> windows) I had to implement that technique. Providing a "add to the root"
> button breaks so many usability rules :D
> I also noticed an anomoly. When you call delete on the node in a tree that
> only has one node (i.e. you're about to delete the last node ever) it will
> delete the node and you'll be left with an empty tree. That's fine, but it
> seems that tree.selected still returns an element (rather than false) even
> though the tree is empty and nothing is selected. I've just worked around
> that by calling unselect(selected) in the ondelete callback after the item
> is deleted.
>
> Hope all that helps, this is a great tree and is working very well for what
> we wanted to do. Provided I'm able to finish every feature I want to
> implement I'll make a donation to say thanks! :D
>
> Cheers,
>
> Brendon
>
> 2009/10/21 vakata <
ivan.bozha...@gmail.com>