This is a migrated thread and some comments may be shown as answers.

Filtering numeric value with a custom dropdown

3 Answers 456 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 07 Jul 2017, 10:10 PM

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!

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 11 Jul 2017, 02:24 PM
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.
0
Joshua
Top achievements
Rank 1
answered on 11 Jul 2017, 06:35 PM
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
0
Georgi
Telerik team
answered on 13 Jul 2017, 02:01 PM
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.
Tags
Grid
Asked by
Joshua
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Joshua
Top achievements
Rank 1
Share this question
or