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

Muti Filter on grid

6 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 30 Oct 2020, 04:41 PM

Hi all,

I need to do a Multi Filter on a column that can has more that one value. For example the value in the column contains the values Blue and Green. When a user selects blue in the multi select as a option I would like for any row that has blue in that that column to be returned. For further explanation see this dojo I created to explain what I am trying to do.

 

I am also looking to create a custom filterable ui widget  that uses the kendoMultiSelect and a custom filter on the data source that will make use of my custom filterable ui widget. I am not sure if this will work. Any help on this would be great.

6 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 03 Nov 2020, 01:31 PM

Hello Brandon,

Unfortunately I don't see a link to the Dojo example you wished to share. Could you please try providing the link again?

In the meantime, I am sharing two resources on multi filtering scenarios, one of which demonstrates how to implement a MultiSelect widget as filter. I hope they will help you achieve the desired result.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Brandon
Top achievements
Rank 1
answered on 03 Nov 2020, 02:51 PM

Thank you Martin for your response I really appreciate it.  I am sorry I forgot to include the link to the Dojo example I created. Here it is https://dojo.telerik.com/@BrandonKnox@AdvisorPeak.com/snippets. For now I have a solution that works. I found this post https://docs.telerik.com/kendo-ui/knowledge-base/grid-how-to-change-multi-checkbox-filter-to-contains which helped me. It feels like a hack. Let me know if there is a better way. 

Thanks,

Brandon

0
Aleksandar
Telerik team
answered on 05 Nov 2020, 10:37 AM

Hi Brandon,

I am afraid I still cannot see the dojo example - the link provided is to the list of snippets in your account, but not an actual dojo. Here is an example link:

https://dojo.telerik.com/@AleksandarEvangelatov/eZiPOjuw

In general, the articles from the How-To sections and the Knowledgebase articles highlight a possible approach to customize further the default behavior of a widget in order to meet a common scenario.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Brandon
Top achievements
Rank 1
answered on 05 Nov 2020, 03:02 PM

Hi Aleksander,

I am sorry I must of messed up the link. This one should work https://dojo.telerik.com/@BrandonKnox@AdvisorPeak.com/AkIDuZUL 

Thanks,

Brandon

0
Accepted
Aleksandar
Telerik team
answered on 09 Nov 2020, 11:20 AM

Hi Brandon,

I can now open the dojo and review the sample. Indeed in the scenario you have the approach to achieve the desired result would be the one demonstrated in the article you cited:

https://docs.telerik.com/kendo-ui/knowledge-base/grid-how-to-change-multi-checkbox-filter-to-contains

I have modified slightly the dojo, as I noticed that clearing the filters throws a JavaScript Error:

filter: function(e){
          if(e.field == "joinedTags" && e.filter != null){   
            e.filter.filters.forEach(function(f){
              f.operator = "contains";
            })
          }
        },

You can review the complete runnable example here.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Brandon
Top achievements
Rank 1
answered on 09 Nov 2020, 02:56 PM

Thanks Aleksandar, 

For confirming that was the best approach. I actually use a Falsy check to make sure that it wasn't undefined either and also the same for the filters object. Once again thank you for your help.

 

Brandon

Tags
Grid
Asked by
Brandon
Top achievements
Rank 1
Answers by
Martin
Telerik team
Brandon
Top achievements
Rank 1
Aleksandar
Telerik team
Share this question
or