Having trouble in copy and paste functionality

Tags: #<Tag:0x00007efc6b687ef0>

When i copy and paste the data in other columns and hit the save button ,it save only first row of paste and all fields does not save.

Ex. I have copied 5 lines and paste it but it save first line only.

code:
afterChange: function(changes, source){
if(source === ‘edit’ || source === ‘paste’){
if((changedRowIndexArr!=null && changedRowIndexArr.length==0) || $.inArray(changes[0][0], changedRowIndexArr) == -1){
changedRowIndexArr.push(changes[0][0]);
}
}

           } ,

Hey @jhapintu1001

Can you prepare a demo? I would need to check what is the changedRowIndexArr and what other table settings do you use.

Generally changes (1st parameter of the afterChange hook) if your case returns an array of arrays, each array is a single changes, where
[row_index, column_index, old_value, new_value].

Hi @aleksandra_budnik,

here is the example http://jsfiddle.net/xwmc10gf/
not getting data for all row when i copy and paste it.

As far as I can see, here

changedRowIndexArr.push(changes[0][0]);

You are adding the index of the first changes row to an empty array. In the result. You also push this value only when the array is empty.

In the result your array length is 1 after doing any amount of changes or empty before doing any changes. If you’d like to save all the indexes or changed rows you’d need to loop over the changes array of arrays.

i tried with two dimensional array looping but still unable to get it.and one more problem when i am sorting the columns and try to input the data manually and save the data,it is not updating.

could please create example for multiple row .

I’ll do my best to help. Can we move to emails? It would be easier to share quick messages via email. You can reach me here support@handsontable.com

Please check your mail .but having issue with columnsorting also

Thank you. I’ve replied so I guess that we can switch to emails and close this topic.