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

Kendo Multiselect Server Filtering populating values not saving

1 Answer 551 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 29 Nov 2017, 08:42 PM
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);
                
           }
       });
   });

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 01 Dec 2017, 02:11 PM
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.
Tags
MultiSelect
Asked by
Jose
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or