FlexGris - Angular 2 - Enforme number (integer), no decimals

Posted by: sricher on 10 April 2018, 2:08 pm EST

    • Post Options:
    • Link

    Posted 10 April 2018, 2:08 pm EST

    Hi,

    I have this column that needs to be an integer. Examples:

    • 4: Allowed
    • 0.1: Not allowed
    • 4.7: Not allowed

    I used format=“n0”, this hides the decimals and rounds the display, but the actual data captured remains the value with decimals. If I double click again in the cell, the value shows the decimal value.

    How can I prevent non-integer values to be entered in this cell?

    Thanks!

  • Posted 11 April 2018, 8:03 am EST

    Hi,

    You need to handle cellEditEnding event and perform required validation.

    Please refer to the following example:-https://stackblitz.com/edit/angular-vkcx6a

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels