telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
464 stars 213 forks source link

[Grid] InCellEdit directive/manual and Inline editing doesn't work with virtual columns #3556

Open yanmariomenev opened 2 years ago

yanmariomenev commented 2 years ago

Describe the bug The InCell editing directive/manual and Inline editing aren't working when the Grid is configured to use virtual columns. This issue is also valid for In-Cell editing as it relies on the column index.

To Reproduce Steps to reproduce the behavior:

  1. open - https://stackblitz.com/edit/angular-lhxlv8-9pa2tb?file=app%2Fapp.component.ts or manual https://stackblitz.com/edit/angular-gprwrz?file=src%2Fapp%2Fapp.component.ts
  2. Try to edit the last columns.
  3. Move the last editable columns in front of OrderID and the editing will work. It seems that when columns aren't rendered in the DOM initially, they cannot be placed in edit mode.
  4. Screen recording - https://screencast-o-matic.com/watch/c3VTjYVDj94
Kiran-R4j commented 2 years ago

Same issue for me as well. We tried different versions of Kendo grid and all of them have same issue.

What I have found is that when column virtualization is turned on the column index is actually a virtual column offset. Say your grid has 20 visible column out of total 60 columns and when you scroll to right by one column we expect it to have column index 21 instead it is returns 20. So if you click on the 60th column this code is actually making 20th column cell editable and you don't notice this as it is not in the view.

Affected Code - Root cause is in columnCellIndex function when used in Virtual Column context returns a Virtual column index. image

Possible Fix - Check if Virtual Column is enabled then use leaf index to calculate column index image

Work Around - Use cellClick handler and call the grid.editCell manually with correct column leaf index instead of the virtual column index Kendo provides