onPaste Code for Datatable Clipboard function

If you are using “clipboard” on Datatable and want to have it saved after a Copy&Paste action you can use this code.

$$(“myDatatable”).attachEvent(“onPaste”,
function(x){
$$(“myDatatable”).getSelectedId(true,true).forEach( function(id)
{ $$(“myDatatable”).updateItem(id, $$(“myDatatable”).getItem(id)); });
} );

(did not find in the help or forum, so i post it here :slight_smile:

But this code works only if all the rows of the paste action are selected.

If the target rows are more (because of multiselct ) it does not work.

Do you have a better code snippet for that , that covers all cases of Copy&Paste in datatable?

.

You can override default copy-paste processing and define a custom paste handler.

http://forum.webix.com/discussion/comment/5727/#Comment_5727

We will update this behavior in 3.0, so data pasting will automatically trigger data saving logic.