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

Multi select in grid filter template?

14 Answers 982 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 11 Feb 2014, 10:37 PM
Hi,

I'm attempting to make a grid with an Excel-like inline column filter that displays distinct values within the data set and allows the user to select multiple values.

I'm using a custom control based off kendoMultiSelect to do this, but noticed that neither it nor the out-of-the-box multi select work properly in a filter template -- it seems that the filter expression it generates ends up containing "[Object object]" for the value instead of an actual value since the control's value() function returns an array.

Just wanted to confirm that this is expected behavior and that there's no work around before I work on a more complex solution (probably hooking the Kendo functions used to generate the filter exp.). I threw up a quick jsfiddle showing the issue here with some static test data (the multi select is on the Ship Name column): http://jsfiddle.net/K63cE/

Thanks,
Nick Blakely

14 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Popov
Telerik team
answered on 13 Feb 2014, 03:51 PM
Hi Nick,

Yes, I am afraid this is the expected behavior. Making a filter menu that utilizes the MultiSelect widget would require a custom solution that relies on the Grid's filterMenuInit event. Once the event is triggered you could add the widget and the custom logic that modifies the filter. I would recommend checking this example, where similar behavior is illustrated.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Nicholas
Top achievements
Rank 1
answered on 13 Feb 2014, 05:27 PM
Thanks, I'll do that.
0
Mark
Top achievements
Rank 1
answered on 13 May 2014, 02:14 AM
Hi Alex,

Just wondering if it's possible to maintain the selections in the multiselect. In the example posted, only the first item is retained.

Regards,
Mark
0
Alexander Popov
Telerik team
answered on 14 May 2014, 10:19 AM
Hi Mark,

I would recommend checking this updated example, where the element's data-bind attribute is removed, so the selection persists.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mark
Top achievements
Rank 1
answered on 15 May 2014, 12:43 AM
Hi Alex

Thanks very much for that, did the trick.

Regards,
Mark
0
Alain
Top achievements
Rank 1
answered on 27 May 2014, 11:23 PM
Hi Alex,

The values in this example persist when element's data-bind attribute is removed.

However, I try to use the filters values with server paging but I can't retrieve the values for the server?

I retrieve the filters values like this and I send it to the server with the paging information.

var gridFilters = $("#grid").data("kendoGrid").dataSource.filter().filters;

The selection persist and the gridFilters is correct when the filters are applied but is empty as soon as the page change.

Any idea?

Thanks
Alain








0
Alexander Popov
Telerik team
answered on 29 May 2014, 04:00 PM
Hello Alain,

I am not entirely sure what is causing this behavior. This scenario is not supported out of the box and implementing it requires a custom solution that is beyond the scope of our support services.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Victor
Top achievements
Rank 1
answered on 10 Jul 2014, 04:38 PM
I implemented a solution that involved creating a custom widget.  Its seems to be working.  Getting the custom widget to work in conjunction with the built-in filtering mechanism was tricky.  Hopefully, the ability to filter columns with a checkbox list is added as a built-in feature.  You can see my implementation here:

http://jsfiddle.net/victordscott/5kbfY/3/
0
Mark
Top achievements
Rank 1
answered on 22 Jul 2014, 08:34 AM
[quote]Alexander Popov said:Hi Mark,

I would recommend checking this updated example, where the element's data-bind attribute is removed, so the selection persists.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
[/quote]

Hi Alex,

It seems that with data-bind removed, then the filter cannot apply simultaneously with other filters. However, with data-bind present, the selection does not persist between searches.
Is there a way to achieve both persistent search term AND filtering multiple columns simultaneously?

Regards
Mark
0
Alexander Popov
Telerik team
answered on 23 Jul 2014, 02:28 PM
Hi Mark,

Although not supported out of the box, this could be achieved by getting the current filter, then merging it with the one specified in MultiSelect widget and applying it again.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Greg
Top achievements
Rank 1
answered on 16 Apr 2015, 03:53 PM
I have same issue. Can you please share solution.
0
Victor
Top achievements
Rank 1
answered on 16 Apr 2015, 05:06 PM

I think that this feature was implemented in the last release.  See demo here:

http://demos.telerik.com/kendo-ui/grid/filter-multi-checkboxes

 

0
Greg
Top achievements
Rank 1
answered on 16 Apr 2015, 05:50 PM
Thanks for your reply.
Actually It would be difficult for the user to filter with check box when we have large result set.
So i want to implement filter with mutliselect.

Please provide me some solution.
0
Alexander Popov
Telerik team
answered on 20 Apr 2015, 08:36 AM
Hi Greg,

As previously mentioned, using a MultiSelect widget in the filter menu is not supported. Implementing this feature would require a solution that is outside the scope of our support services.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Nicholas
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Alain
Top achievements
Rank 1
Victor
Top achievements
Rank 1
Greg
Top achievements
Rank 1
Share this question
or