Show only integers in grid pop-up editor

3 posts, 1 answers
  1. AP
    AP avatar
    205 posts
    Member since:
    Apr 2010

    Posted 10 Sep Link to this post

    I have a grid pop-up editor defined, which uses a numeric textbox. I'm trying to get this to show only integers, but I'm not having any luck.
    From other forum posts, data-format="0"  should work, but this breaks the grid, with an 'e.slice is not a function' error.
    Currently it is defined as:-

    <p><label>Year:</label><input type="text" name="Year" data-type="number" data-bind="value:Year" data-role="numerictextbox" data-spinners="false"  data-decimals="0"/></p>

     

    This works fine, except shows two decimals.

    If I change it to:-

    <p><label>Year:</label><input type="text" name="Year" data-type="number" data-bind="value:Year" data-role="numerictextbox" data-format="0" data-spinners="false"  data-decimals="0"/></p>

     

    The grid stops working, and the error is raised.

    How can I get it to work?

  2. Answer
    Preslav
    Admin
    Preslav avatar
    234 posts

    Posted 12 Sep Link to this post

    Hello Andrew,

    Based on the provided information, I believe that the correct format should be:

    data-format="n0"

    Additionally, more information about the Number Formatting is available in this article:

    Regards,
    Preslav
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. AP
    AP avatar
    205 posts
    Member since:
    Apr 2010

    Posted 14 Sep Link to this post

    Thanks, that worked
Back to Top