Kendo Multiselect Server Filtering populating values not saving

2 posts, 0 answers
  1. Jose
    Jose avatar
    1 posts
    Member since:
    Aug 2013

    Posted 29 Nov 2017 Link to this post

    My Issue is that once I had upgraded to version 2017.3.913,  pre-populating the multiselect did not work.

    The Ajax does return data, and throws no error when setting the value.

    I have also tried a default random value to see if I could get a dummy pre selected value and nothing.

    Is there another way to set value with text and id into the multiselect field.

    Thank You.

    Example of code below.

    <table style="width:100%; margin:0px; padding:0px;">
                    <tr>
                        <td style="margin:0px; padding:0px;position:relative;">
                            @(Html.Kendo().MultiSelect().Name("VesselMultiDropDown")
                                .DataTextField("Text").DataValueField("Value")
                                .Filter("contains")
                                .IgnoreCase(true)
                                .DataSource(source =>
                                {
                                    source.Read(read =>
                                    {
                                        read.Action("JsonGetJobVisitExporWithBarcodeStatusOnlytMultiDropDown", "DropDown").Data("getEnvironment");
                                    })
                                    .ServerFiltering(true);
                                })
                                .AutoClose(false)
                                .AutoBind(false)
                                
                                        .HtmlAttributes(new { style = "width:100%-22px;margin-right:22px;" })
                                .Placeholder("Select vessel...")
                            )
     
                        </td>
                    </tr>
                </table>

     

    jQuery(window).load(function () {
     
           $.ajax({
               url: "@Url.Action("GetSessionVessels", "Barcode")",
               type: 'POST',
               traditional: true,
               success: function (dataVessels) {
     
                   $("#VesselMultiDropDown").data("kendoMultiSelect").value(dataVessels);
                    
               }
           });
       });
  2. Neli
    Admin
    Neli avatar
    157 posts

    Posted 01 Dec 2017 Link to this post

    Hello Jose,

    Based on the provided snippet I have prepared a sample project. The Kendo version in the project is 2017.3.913, but I have also tested with the latest 2017.3.1026. As you could see in the linked screencast, the items in the MutliSelect are pre-selected correctly. 

    The following article, regarding the pre-selection of items in MultiSelect could be helpful.

    May I ask you to modify the attached sample project, reproduce the issue and attach it back for further review? This way we could examine it locally and assist you further. 


    Regards,
    Neli
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top