frontend a duplicate multiselect element is created.

2 posts, 1 answers
  1. Sanjay
    Sanjay avatar
    11 posts
    Member since:
    Jul 2013

    Posted 10 Apr 2014 Link to this post


    I have defined a multiselect element in my page. The I am trying to get the value of select items using javascript. When the .Value line is executed on the frontend a duplicate element is created.

    The pre and post image is attached.

    Please help

    @(Html.Kendo().MultiSelectFor(m => m.SeleFromAvail)                           
           .HtmlAttributes(new { id = "seleLst", style = "width:940px;" })                           
    param = $("# seleLst ").kendoMultiSelect().data("kendoMultiSelect").value();
  2. Answer
    Georgi Krustev
    Georgi Krustev avatar
    3747 posts

    Posted 11 Apr 2014 Link to this post

    Hello Sanjay,

    The widget is rendered twice, because the JavaScript code from your code snippet actually initialize the rendered widget for second time. If you need to retrieve the client instance of the widget then you will need to use this:
    param = $("# seleLst ").data("kendoMultiSelect").value();
    Find more information about how to retrieve the client instance here.

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top