We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

The value is not getting binded when NumericTextBox control is used as a cell editor in Ag-Grid

Hi Team,


Version Info:- @syncfusion/ej2-angular-inputs": "^17.4.39"

When NumericTextBox is being used as a custom cell-editor in ag-grid, its value is not getting binded when any change is made in control from keyboard and other cell is clicked.
However change do get binded if increment/decrement icons of control is used.
I have attached a sample project. In project, the first column by headername "Make" is using numeric editor. Type a number and click on any other cell.

Thanks
Tuariq

Attachment: Numeric_e1a1b62e.zip

3 Replies

BC Berly Christopher Syncfusion Team January 7, 2020 05:18 PM UTC

Hi Tuariq, 
 
Greetings from Syncfusion support.  
 
We would like to inform you that, while focus out the AG-Grid cell, then getValue method will be fired. In this method, we can return the component element value to maintain the selected value from the component. Please check the attached sample in the below link. 
 
 
Regards, 
Berly B.C 



TU Tuariq January 10, 2020 09:25 AM UTC

Hi Berly,

Thank you for the help. This had solved my issue.
I just had a query why we cannot just return the bounded property in getValue().

The control is binded [(value)]="selectedVal" and we can simply return this selectedVal in getValue().
Why we have to use this line: return (document.getElementById("numeric") as any).ej2_instances[0].element.value;

Is this a workaround for some bug?


Thanks
Tuariq


SP Sureshkumar P Syncfusion Team January 13, 2020 06:26 AM UTC

Hi Tuariq, 
 
We have validated your query, in the AG-Grid component getValue method trigger before our component change event triggers. That is the reason the binded value property does not get updated while getting the value inside the getValue method. So, we suggest you use the below workaround solution to get rid of your issue. 
 
Regards, 
Sureshkumar P 


Loader.
Up arrow icon