TonyGermaneri / canvas-datagrid

Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.
BSD 3-Clause "New" or "Revised" License
1.42k stars 184 forks source link

`afterpaste` event doesn't include pasted data #549

Open romanstetsyk opened 1 year ago

romanstetsyk commented 1 year ago

Expected behavior and actual behavior.

Expect: afterpaste event to provide a way to access the values pasted. Actual: afterpaste event doesn't provide the values of the cells, only the indices of the affected cells. Suggestion:

  1. e.cells contains an array of affected cells. Each element of the array is of the form [rowIndex, columnIndex, boundRowIndex, boundColumnIndex]. I suggest adding a fifth element to the array with the new value of the cell.

    or

  2. Add a new property, rows, containing entire rows affected by the paste. This is similar to how the beforeendedit event includes the e.cell.data property with the data for the entire row.

Steps to reproduce the problem.

Specifications like the version of the project, operating system, or hardware.

romanstetsyk commented 1 year ago

I'm willing to make a PR. Please let me know if you like any of these approaches or have any suggestions