mbraak/jqTree — pull request #17 by rosenfeld (2012-04-30 21:55:03+00:00)
Title: Allow moveNode to be canceled through ev.preventDefault()

Here is a suggestion for allowing the move action to be cancelable or confirmable.

Here is a possible usage:

$('#tree').bind('tree.move', function(ev) {
ev.preventDefault()
jConfirm('Are you sure?', 'Please confirm', function(confirmed) {
if (confirmed) ev.move_info.do_move()
})
})

In my particular case, I'm not using do_move as I need to reload the parent of the target node (or the target node itself if the position is 'inside').