To enable the possibility to copy/paste Tree data by the CTRL+C/CTRL+V keyboard shortcuts you should use parameter clipboard.
The parameter can have one of 3 values:
Each of the types has its specificity and define its behavior of copying.
Setting the desired behavior of copying
tree = new webix.ui({
view:"tree",
...
clipboard:"insert"
});
Related sample: Pasting New Items
It's the default type and can be also specified by setting the true value.
The type of copying can be characterized as in:
Setting the 'modify' behavior of copying
tree = new webix.ui({
view:"tree",
...
clipboard:"insert"
});
Related sample: Pasting Items' Titles
Setting the 'insert' behavior of copying
tree = new webix.ui({
view:"tree",
...
clipboard:"insert"
});
Related sample: Pasting New Items
The 'custom' value allows you to specify a custom logic for the paste operation.
To apply a custom 'paste' behaviour to the tree:
tree = new webix.ui({
view:"tree",
...
clipboard:"custom"
});
This command will cancel the predefined behaviour for the paste operation.
//the code does nothing but alerts messages
tree.attachEvent("onPaste", function(text) {
webix.message("Node is pasted: " + text);
});
Tree invokes the onPaste event when the user presses CTRL+V keys combination.
Related sample: Custom Clipboard Operations
Back to top