最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Pasting rows copied from excel into handsontable - Stack Overflow

programmeradmin3浏览0评论

Think of an excel with 15 rows, in this excel when I select and copy rows 2, 4, 7, 9, 11 and 12, it copies all rows between rows 2 and 12. When I paste it to Handsontable, it pastes it in the same way. I want to paste the rows I selected in handsontable.

Note: These rows are examples and I do not want to do any work in Excel, I want to do it in HandsonTable.

I tried this method:

 scope.hot.addHook('afterPaste', function (changes){}

All the lines I copied in the Changes parameter come as an array.

Think of an excel with 15 rows, in this excel when I select and copy rows 2, 4, 7, 9, 11 and 12, it copies all rows between rows 2 and 12. When I paste it to Handsontable, it pastes it in the same way. I want to paste the rows I selected in handsontable.

Note: These rows are examples and I do not want to do any work in Excel, I want to do it in HandsonTable.

I tried this method:

 scope.hot.addHook('afterPaste', function (changes){}

All the lines I copied in the Changes parameter come as an array.

Share Improve this question asked Jan 20 at 13:23 Celal SunnetciCelal Sunnetci 395 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Handsontable doesn't provide a non-consecutive cell copy/paste. However, you can use the beforePaste to return false and read data from getSelected() method. It will give you cell cooordinates for all the ranges. Then, based on ranges, you can call getDataAtCell() method to read the data that is copied.

发布评论

评论列表(0)

  1. 暂无评论