Integer column filter value showing as decimal

11 posts, 1 answers
  1. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 10 Apr 2015 Link to this post

    Hi, how do I get the numeric textbox in the grid filter row to show integer values for an integer column?  I can apply the filter correctly but after the filter applies it will change "33" to "33.00".
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 14 Apr 2015 Link to this post

    Hello Bob,

    You can set format on the filterable on the column like this:

    field: "YourField",
    filterable: {
            ui: function (element) {
                     element.kendoNumericTextBox({
                         format: "n0"
                     });
                 }
            }

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 14 Apr 2015 in reply to Kiril Nikolov Link to this post

    Kiril, thanks for reply, but can you provide the syntax for the server-side wrapper?
  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 15 Apr 2015 Link to this post

    Hello Bob,

    It is practically the same:

    .Filterable(f => f.UI("myfilter"));
      
    <script>
    function myfilter(element) { 
        element.kendoNumericTextBox({
                   format: "n0"
            });
    }
    </script>

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 15 Apr 2015 in reply to Kiril Nikolov Link to this post

    This doesn't work as-is when using the filter row.  I was able to verify in the Kendo UI Dojo.  It seemed to work fine for the default filter type though.  Any suggestions?
  6. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 17 Apr 2015 Link to this post

    Hello Bob,

    It will not work for the filter row. If you are using the filter row then use the following approach:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.cell.template

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 17 Apr 2015 in reply to Kiril Nikolov Link to this post

    And how do I do this for the paid product (server side)?
  8. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 21 Apr 2015 Link to this post

    Hello Bob,

    It is practically the same:

    columns.Bound(p => p.Freight).Width(250).Filterable(ftb => ftb.Cell(cell => cell.Operator("gte").Template("foo")))

    Where "foo" is the function, behind the template.

    Regards,

    Kiril Nikolov

    Telerik

     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  9. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 21 Apr 2015 in reply to Kiril Nikolov Link to this post

    If anyone is interested, here's what the filter function I made looks like:

    function gridFilterIntegerNumericTextbox(args) {
        args.element.kendoNumericTextBox({
            format: "n0",
            decimals: 0,
        });
    }
  10. Deepti
    Deepti avatar
    1 posts
    Member since:
    Jul 2018

    Posted 21 Jul 2020 in reply to Bob Link to this post

    Could you please share the complete code snippet that how you have used it?
  11. Petar
    Admin
    Petar avatar
    468 posts

    Posted 22 Jul 2020 Link to this post

    Hi Deepti,

    As the last reply in this thread is from 2015 and may be outdated, can you specify what functionality do you want to implement for the Grid component?

    What 'complete code snippet' do you need?  

    Regards,
    Petar
    Progress Telerik

Back to Top