Igniteui-angular: igx-grid: is there any way to validate cell value keep cell in edit mode?

Created on 28 Feb 2019  路  2Comments  路  Source: IgniteUI/igniteui-angular

Question

I have an issue with validating cell value and it doesn't work as expected.

  • igniteui-angular version: 7.1.8
  • browser: N/A

What I want to do is validate cell value and keep cell in edit mode if it is invalid. In order to achieve that, I'm trying to handle blur event for an input in <ng-template igxCellEditor>. But blur event is sometimes fired and sometimes not.

  • When I press (Shift+)Tab key or click another cell, blur event is FIRED.
  • When I press Enter key, blur event is NOT FIRED.

Here is a sample
https://stackblitz.com/edit/igx-grid-custom-edit-template

Does my approach make sense? Or is there a better way?

cell-editing general question

Most helpful comment

@ddincheva , thank you for answering and logging a new issue. I understand it's currently impossible to achieve what I'd like to.

All 2 comments

Hello @tkiryu, currently default grid behavior that we provide is the following: when you try to enter edit mode for a specific cell it can be canceled, when the cell is edited you can define only if the value to be submitted or not, but you can not define if the cell to stays in edit mode or to escape. So I logged a new issue(feature-request: #4135) to reconsider this behavior.
Currently I can not suggest you a solution that will work in all cases: Here you can see a sample that fulfill your need on tab and enter, but will not work as expected when you click over another cell.

@ddincheva , thank you for answering and logging a new issue. I understand it's currently impossible to achieve what I'd like to.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SAndreeva picture SAndreeva  路  3Comments

nikunjgajera picture nikunjgajera  路  3Comments

Hypenate picture Hypenate  路  3Comments

mkamiishi picture mkamiishi  路  3Comments

nikunjgajera picture nikunjgajera  路  3Comments