handsontable-chosen-editor icon indicating copy to clipboard operation
handsontable-chosen-editor copied to clipboard

how can i use copy AND paste function?

Open itwshen opened this issue 5 years ago • 5 comments

when i use this editor, the copy and paste will not work? how can i deal with this condition ? Please

itwshen avatar Jul 02 '19 12:07 itwshen

when i use handsontable7.0.3.full.js , copyPaste function will not work , but when i use the version handsontable0.19.0 that you use in you example, it can work ; how should i do with handsontable7.0.3?

itwshen avatar Jul 03 '19 07:07 itwshen

Sorry, I am currently not actively working on this. I am looking to merge this https://github.com/mydea/handsontable-chosen-editor/pull/16, which might fix your issue (but not sure).

mydea avatar Jul 03 '19 07:07 mydea

I got stuck on this issue too. Are there any clues to solve this problem? @mydea @stw13813013798

Even-Lau avatar Aug 20 '19 05:08 Even-Lau

This is for Handsontable 5.0.0

let cp_row, cp_column, cp_row2, cp_data, cp_validate;
function cp_handler(e) {
  var evtobj = window.event? event : e
  if (evtobj.keyCode == 67 && evtobj.ctrlKey){
    cp_data = new Array();
    for(let i = cp_row; i <= cp_row2;i++){
      cp_data.push(table.getDataAtCell(i, cp_column));
    }
    cp_validate = cp_column;
  }
  if (evtobj.keyCode == 86 && evtobj.ctrlKey){
    if(cp_validate != cp_column){
      //alert('Do tohoto sloupce nelze vložit tyto data.');
    } else {
      let setData = new Array();
      for(let i = cp_row; i <= cp_row + cp_data.length - 1;i++){
        setData.push([i, cp_column, cp_data[i-cp_row]]);
      }
      table.setDataAtCell(setData);
    }
  }
}
document.addEventListener('keydown', cp_handler);

then in new Handsontable( etc. copyPaste: false afterSelection: (row, column, row2, column2, preventScrolling, selectionLayerLevel) => { cp_row = row; cp_column = column; cp_row2 = row2; }

Lokomotom avatar Oct 07 '19 10:10 Lokomotom

how can i use copy AND paste function?Please

xiaosean666 avatar Jul 02 '20 02:07 xiaosean666