Kendo Window not rendering dropdown list

6 posts, 0 answers
  1. Atul
    Atul avatar
    13 posts
    Member since:
    Mar 2012

    Posted 19 Mar 2014 Link to this post

    Hi All,


    I have created partial view which contain multiple dropdown list and I am rendering this partial view on different Window. 

    When I opened this partial view on "xyz" window it will work as expected, but when I opened same partial view on another window (abc) all dropdownlist converted into textbox control.

    Any thoughts?

    Thanks-
    Atul K
  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 19 Mar 2014 Link to this post

    Hi Atul,

    If you load the same partial view multiple times on the same page, you need to use different IDs and Name()'s for all elements and Kendo UI widgets, otherwise you will end up with duplicate IDs on the page and the HTML markup will become invalid.

    Regards,
    Dimo
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Atul
    Atul avatar
    13 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2014 in reply to Dimo Link to this post

    Hi Dimo, thanks for your reply.

    Here I am rendering partial view on different Windows and I am closed the window before opening another window.

    and you suggested use different IDs for all elements, so how can assign different ID's for all elements from Partial view?

    Thanks-
    Atul 
  5. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 20 Mar 2014 Link to this post

    Hi Atul,

    Closing a Window does not remove it from the DOM. If you will not be needing a particular Window again, you can destroy() it in its deactivate event. In this way you will not have to use different IDs for the content in the new instances.

    http://docs.telerik.com/kendo-ui/getting-started/web/window/overview#destroying-a-kendo-ui-window

    http://docs.telerik.com/kendo-ui/api/web/window#events-deactivate

    Applying unique Names to the Kendo UI widgets inside the Window is a general development task, which involves using string variables and is not directly related to Kendo UI. Imagine you have a plain textbox (<input type="text" id="MyTextBox" />) inside a partial view, which will be loaded multiple times on a page. How will you apply different IDs to each textbox instance?

    Regards,
    Dimo
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  6. Atul
    Atul avatar
    13 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2014 in reply to Dimo Link to this post

    Thanks Demo,

    This elucidation is work for me. I have removed all elements from Window on deactivate event of window.

     deactivate: function () {
                    $(this.element).empty();
                }

    Please correct me if this approve is not correct or do you have any other better approach to resolved my issue.

    Thanks-
    Atul K.
  7. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 20 Mar 2014 Link to this post

    Hi Atul,

    Before removing DOM content, which contains Kendo UI widgets, it is highly recommended to call kendo.destroy().

    http://docs.telerik.com/kendo-ui/api/framework/kendo#methods-destroy

    Regards,
    Dimo
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready