I need to prevent moving to the next or previous row in igx-grid which happens during editing when Tab or Shift+Tab are hit.
(And to prevent editing of certain cells based on data)
In my sandbox solution (stackblitz) everything works fine up to the point when a width of the grid triggers scrolling(can be emulated with F12 and DevTools to the right occupying a half of the screen).
In such case grid.getCellByColumnVisibleIndex might return undefined.
Is there a safe analog?
Hi Dan,
I am glad that you have resolved your issue.
Thank you for using Infragistics components.
Thank you for the help, Martin
Hi, I have updated the sample fixing this behavior.
Please test it on your side and let me know if you need any further assistance with this matter.
There is an issue: 'tab's should not activate non-editable cells. If 'City' field is in between of editable cells (stackblitz) it is be activated. That's why I had to use that awkward
Hi,
After further investigation, my suggestion is to use a different approach by passing a callback function as a third parameter of the getNextCell and getPreviousCell methods in order to validate a given cell:
const followingPosition = shift ? this.grid.getPreviousCell( activeCell.row, activeCell.column, (column: IgxColumnComponent) => this.isEditable(column, evt.target.row.rowData) ) : this.grid.getNextCell( activeCell.row, activeCell.column, (column: IgxColumnComponent) => this.isEditable(column, evt.target.row.rowData) );