Pasting multiple nodes in jsTree -


the documentation crrm plugin jstree states copy() method "copies node (prepares pasting)" , takes parameter "can dom node, jquery node or selector pointing element within tree". of singular.

for paste() says "pastes copied or cut nodes inside node". implying supports pasting of multiple nodes.

i have been unable figure out, however, how copy multiple nodes. possible? if so, need pass copy() method?

i should mention using checkboxes plugin, , node selection copy done using them. call get_checked() method checked nodes. not work pass result of call copy(). end doing looping result of get_checked(), id of each node, , call copy() , paste() each one.

the trouble is, handler "move.jstree" event (fired when pasting) ajax call serverside update. if pasting 10 nodes 10 ajax calls silly. want 1 ajax call handles pasting of multiple nodes. must possible, right?

thanks in advance pointers.

answering own question.

all needed concatenate node id's selector string , call...

$('jstreediv').jstree('copy', '#node1, #node2, #mode3'); 

...to copy multiple nodes, , call paste paste them all...

$('jstreediv').jstree('paste', '#id-of-target-folder'); 

so documentation issue.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -