Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i use copy AND paste function? #17

Open
itwshen opened this issue Jul 2, 2019 · 5 comments
Open

how can i use copy AND paste function? #17

itwshen opened this issue Jul 2, 2019 · 5 comments

Comments

@itwshen
Copy link

itwshen commented Jul 2, 2019

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

@itwshen
Copy link
Author

itwshen commented Jul 3, 2019

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?

@mydea
Copy link
Owner

mydea commented Jul 3, 2019

Sorry, I am currently not actively working on this. I am looking to merge this #16, which might fix your issue (but not sure).

@Even-Lau
Copy link

Even-Lau commented Aug 20, 2019

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

@Lokomotom
Copy link

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;
}

@xiaosean666
Copy link

how can i use copy AND paste function?Please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants