I have two questions. If a column shows icons like countries flags and I want to filter that column on a specific country is it possible for the filter to present a list of available countries and their flags?
Second question is about the the same column. Let's say I want to sort that column not on a country name but rather on some business logic or on another column's data. Can you explain what a basic approach might be?
Thanks
5 Answers, 1 is accepted
Hi, Mark,
See the answer to your questions below:
- Custom Filter UI
If you are referring to the the FilterMenu, then you can initialize your own DropDownList and use its capabilities for templating to show the flag and the country name.
If you are referring to the FilterMultiCheck, then there is the itemTemplate that can be used
- Custom Sort Order
The data source sort configuration has a compare function that can be used to sort in a custom way:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/sort#sortcompare
Take a look at these resources and let me know in case you need further assistance.
Regards,
Alex Hajigeorgieva
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
All my questions are about using your product with Angular. Am I assuming correctly that all of this is available for my Angular development?
Thanks
Hi, Mark,
I am sorry but it did not become apparent that you were inquiring about Kendo UI for Angular, this thread was posted in the jQuery Kendo UI where we have wrappers for Angular 1.x. If you need the answers for these questions regarding the Kendo UI for Angular suite, then we can duplicate the thread and add it to the Angular forum that deals with these questions:
https://www.telerik.com/forums/kendo-angular-ui/grid
Alternatively, you may post there instead, just let me know if you would like me to open a forum thread on your behalf or move this one there.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Thanks
Hi Mark,
About the first question, the requirement can be achieved by implementing a custom filter. Please check the following article that demonstrates how to create custom Filter Row and Filter Menu components:
https://www.telerik.com/kendo-angular-ui/components/grid/filtering/reusable-filter/
For example the custom filter component can consist of a MultiSelect component and upon selecting a value for the MultiSelect it can filter the designated column. The [field] property of the column can be bound to strings representing each country, but these strings can be used within the kendoGridCellTemplate to show the respective country flag.
About the second question, the (dataStateChange) or (sortChange) event of the Grid can be handled and if the emitted event object contains a SortDescriptor for the specific column, then it can be manually changed by the developer to target another column or implement any other business logic that will sort the data as desired.
I hope the provided information helps. Please let me know in case any additional information or details are required for this case. Thank you.
Regards,
Svetlin
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.