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
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.................../////
}
}
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
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
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
Same issue here, multiselect clears out. i have seen that somehow selected items are convert from array to comma separated values. could be why they are not picked
Hi Nahashon,
Could you please demonstrate the problem in a Dojo demo? Below I am posting one where the MultiSelect is used as a column row filtering. Feel free to modify it to showcase the problem.
https://dojo.telerik.com/MjRIezhQ
regards,
Nikolay
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