Hello,
We are currently updating from Infragistics 15.1 to 16.2. One issue that we found is that the igNumericEditor in a grid row edit dialog cannot be setup with a fixed number of decimals like in 15.1.
Here is a 15.1 example: http://jsfiddle.net/k3Lx2v73/1/ Double click the first row in the grid to bring up the edit dialog. Click on the "Units In Stock" field, and 39.0000000000 shows up. This is expected because i have the minDecimals and maxDecimals values set to 10. Likewise, a user cannot add places.
Here is a 16.2 example: http://jsfiddle.net/uofcft8z/1/ Double click the first row in the grid to bring up the edit dialog. Click on the "Units In Stock" field, and 39 shows in the edit dialog. This is an issue because the user could enter in additional decimal places that might not be saved to the server (e.g. they could enter in 39.000000000000001 which would not save correctly because it goes beyond 10 decimals.
Is there a way to duplicate the 15.1 functionality in 16.2?
Thanks,
Paul
Thanks, using the keypress event should work. Thanks for your assistance.
Hello Paul,
as I pointed out in my previous reply, the validation is done on blur. The end user is able to type in as much digits after the decimal point as he wants but he is not able to enter more digits than the ‘maxDecimals’ as when the editor is blurred the value will be trimmed to the ‘maxDecimals’. So it is not possible for your users to send a value with more digits after the decimal point than the allowed value.
However, if you want to bypass this behavior, you can attach to the ‘keypress’ event and you can cancel it if the number of digits is greater than the ‘maxDecimals’. Another option would be to overwrite the editor’s logic but this is highly not recommended, as this would open the door for unexpected behaviors and issues.
If this behavior is crucial for your project – I would recommend you to use the ‘keypress’ event to stop the end users from entering more digits.
I hope this will help you with your scenario!
Regards, Alexander Marinov, Infragistics
Hi Alex,
Thanks for the update. The link you sent is helpful with the differences. However, we really need a way to duplicate the decimal precision functionality that existed in 15.1. I understand that there are additional validation features we can use, but from a user-perspective, I don't think they should be allowed to type in more decimals then are allowed in the first place. For example, if there is a field in dollars, a user should never be able to enter in more then two decimals. It's just nonsensical.
Are there any settings that exist in the new editors where we could use a fixed number of decimals like in 15.1?
Thank you for using Ignite UI!
The behavior that you are observing is the designed one for the new igNumericEditor. A complete new set of Ignite UI editors was introduced with the release of version 15.2.
In this case the validation of the value that is entered is done when blurring the editor. When the editor is blurred, the user will see that the value is cropped if he has entered more digits than the maxDecimals value. If you want to explicitly point the attention of the user to that - you can implement some custom logic and you can notify the user after the blur event is fired.
As you are migrating from the old to the new editors, you can also check this topic to see the other changes related to the numeric editor - https://www.igniteui.com/help/migrating-to-the-new-ignumericeditor
Best regards, Alexander Marinov,Infragistics