handsontable icon indicating copy to clipboard operation
handsontable copied to clipboard

Copy Paste of muliple rows calling only one OnChange event for the control

Open prabhat007 opened this issue 14 years ago • 5 comments

Hi,

First of all thanks for this nice control. Its really very great excel like web tool.

Actually I was exploring this nice tool and in the process I came through that when we copy multiple rows from one MS Excel sheet and paste those into this control only one hit to the OnChange defined event raised. Will you please guide me how this can be achived in this control. Actually I want to raise this event for the all rows that I am going to paste there. Thanks in advance.

Thanks

prabhat007 avatar Jun 29 '12 14:06 prabhat007

I was having the same problem earlier, @warpech highlighted : There already have a method handsontable('getData') to return 2-dimensional JSON array with the current grid data. Refer to this jsfiddle sample : http://jsfiddle.net/bwv2s/1/

azizasm avatar Jul 02 '12 06:07 azizasm

Hi Azizasm,

You are absolutely right that there is already a method 'getData' which will return 2-dimensional JSON array with the current complete grid data. In fact my requirement is different, I want to capture the OnChange event for all rows which I am going to paste in the control and after capturing the event for each row I want to do some operations on those rows seperately. Please suggest.

Thanks

prabhat007 avatar Jul 02 '12 12:07 prabhat007

Did you look at the param that is sent to onChange callback? It contains a multiarray that has coordinates of all rows/cols affected by the paste (not only for the first cell).

warpech avatar Jul 13 '12 11:07 warpech

@prabhat007 how did you manage your use case.? still it hits afterChange for only one row.

dishant8 avatar Aug 12 '16 18:08 dishant8

I too have this use case. How to get afterChange/beforeChange fired for all rows that I paste?

mohithg avatar Oct 28 '16 18:10 mohithg