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

How to hold selected elements in MultiSelect after filtering?

6 Answers 709 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Denis
Top achievements
Rank 1
Denis asked on 23 Jul 2014, 10:09 AM
Hi,

I'm using MultiSelect for filtering in  kendo grid. When I select 2 or more items all selected items,beside 1-st selected item, vanish after filtering.
They vanish after executing of next string of kode :" $("#" + gridId).data("kendoGrid").dataSource.filter(filter)" .
How to solve this problem?

Thanks,
Denis Isaikin.

6 Answers, 1 is accepted

Sort by
0
Denis
Top achievements
Rank 1
answered on 23 Jul 2014, 10:18 AM
my code for creating of MultiSelect:
function FilterMultiselect(element, columnName, storeParam, gridId, url) {

    var menu = $(element).parent();
    var multiselect = element.kendoMultiSelect({
        valuePrimitive: true,
        dataTextField: "Text",
        dataValueField: "Value",
        
        dataSource: {
            transport: {
                read: url
        }
        }, filter: "contains"
    }).data("kendoMultiSelect");
    menu.find("[type=submit]").on("click", { widget: multiselect }, function (e) {
/////..............any code.................../////
                                                               }
}
0
Georgi Krustev
Telerik team
answered on 24 Jul 2014, 11:26 AM
Hello Denis,

Generally speaking, MultiSelect widget will not be able to show the selected items as tags if they cannot be found in its data source. In other words if MutliSelect data source does not contains any of the selected items then it will not be able to show them.
With regards to your particular case, the given information does not reveal what exactly is causing this problem. Could you please create a simple Dojo demo, which reproduces the problem? Thus I will be able to observe the erroneous behavior locally and advice you further.

Regards,
Georgi Krustev
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 15 Apr 2015, 07:25 PM
I have same issue. Please share if you already resolved it.
0
Georgi Krustev
Telerik team
answered on 17 Apr 2015, 08:36 AM
Hello Greg,

If you are using Q1 2015 SP1 (2015.1.408), then you are referring to this issue, which is already resolved and the fix will be available in the next internal build.

In the case, when you try to select value that does not exist in the data source, after filtering for instance, then the widget will not be able to select it. To overcome this limitation, you will need to ensure that the value you would like to select is present in the data source (clear the filter for instance).

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
David
Top achievements
Rank 1
answered on 19 May 2016, 02:17 PM

This is not the case for me.  I have a multi select in the grid filter row and I'm selecting values that exist in the grid datasource and yet the multiselect clears out after running the filter.

Column definition:

{
title: "AppLabel.EquipmentType.Name",
    field: "EquipmentType",
    type: "string",
filterable: {
multi : "true",
cell : {
showOperators : false,
template: function (args) {
                args.element.kendoMultiSelect({
                    dataSource: {
transport: {
read: {
url: "/WebServices/EquipmentService.asmx/GetEquipmentTypesForEquipmentGrid",
dataType: "json",
contentType: "application/json; charset=utf-8",
type: "POST"
}
},
schema: {
data: "d.Data"
}
},
                    dataTextField: "Value",
                    dataValueField: "Value",
                    valuePrimitive: true
                });
            }
}
}
  },

See the attach screenshots

 

 

0
Georgi Krustev
Telerik team
answered on 23 May 2016, 09:00 AM
Hello David,

Could you send us a repro demo? Thus we will be able to investigate the case and find a proper solution much faster. 

As a side note, have you tried the latest official release of Kendo UI?

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
MultiSelect
Asked by
Denis
Top achievements
Rank 1
Answers by
Denis
Top achievements
Rank 1
Georgi Krustev
Telerik team
Greg
Top achievements
Rank 1
David
Top achievements
Rank 1
Share this question
or