How to hold selected elements in MultiSelect after filtering?

7 posts, 0 answers
  1. Denis
    Denis avatar
    2 posts
    Member since:
    May 2014

    Posted 23 Jul 2014 Link to this post

    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.
  2. Denis
    Denis avatar
    2 posts
    Member since:
    May 2014

    Posted 23 Jul 2014 Link to this post

    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.................../////
                                                                   }
    }
  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 24 Jul 2014 Link to this post

    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!
     
  5. Greg
    Greg avatar
    19 posts
    Member since:
    May 2012

    Posted 15 Apr 2015 Link to this post

    I have same issue. Please share if you already resolved it.
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 17 Apr 2015 Link to this post

    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!
     
  7. David
    David avatar
    19 posts
    Member since:
    Feb 2015

    Posted 19 May Link to this post

    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

     

     

  8. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 23 May Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready