Filtering numeric value with a custom dropdown

4 posts, 0 answers
  1. Joshua
    Joshua avatar
    6 posts
    Member since:
    Aug 2016

    Posted 07 Jul 2017 Link to this post

    Hi,

    Right now, I'm struggling to implement a custom dropdown filter for a column which displays numerical data. The dropdown doesn't end up getting populated with any of the data from that column. I modified a dojo to demonstrate what I'm talking about. In this dojo, no data displays in the dropdown filter for "Freight". I'm struggling to figure out why this is not working.

    http://dojo.telerik.com/ewesa

    Thanks for your help!

  2. Georgi
    Admin
    Georgi avatar
    676 posts

    Posted 11 Jul 2017 Link to this post

    Hello Joshua,

    The reason why the drop down is not populated is because args.dataSource is undefined. Even then this configuration is placed inside the columns.filterable.cell.template function, you can still define dataSource as when using a regular drop down configuration.

    I modified the sample you sent to use the same data source as the grid and now works as expected:



    Regards,
    Georgi
    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. Joshua
    Joshua avatar
    6 posts
    Member since:
    Aug 2016

    Posted 11 Jul 2017 Link to this post

    Won't initializing a separate dataSource allow for duplicate values coming back for the dropdown? I thought that was the reason to use args.dataSource, so that there are no duplicates: http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.filterable.cell.template
  4. Georgi
    Admin
    Georgi avatar
    676 posts

    Posted 13 Jul 2017 Link to this post

    Hello Joshua,

    We discussed the behavior with the developers and it seems to be a bug. The same functionality works when the type of the column is string but it brakes when it is a number. Check out the following sample:

      
    We will investigate what is causing this behavior and fix it as soon as possible. As a token of gratitude for reporting the issue to us I have updated your Telerik points.

    As a workaround until we fix the issue, you can configure custom data source and return distinct items from your service


    Regards,
    Georgi
    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.
Back to Top