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

DropDownList Remnants on View Change

1 Answer 266 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Jamie asked on 05 Jun 2013, 09:15 AM
Hi,

I'm not sure if this is a bug or just a misunderstanding on my part. I'm also putting this post here, but it may be more relevant for the SPA section!

When using a dropdownlist inside a view (rendered as part of an SPA layout), the following element is created at the foot of the body (as well as the normal markup):
<div style="display: none; position: absolute;" data-role="popup" id="dropdownlist1-list" class="k-list-container k-popup k-group k-reset"><ul aria-live="off" id="dropdownlist1_listbox" aria-hidden="true" role="listbox" tabindex="-1" style="overflow: auto;" unselectable="on" class="k-list k-reset">
On a view change, using layout.showIn(), I was to understand the the view and all its child elements would be removed from the DOM. As it is, these elements remain - if the view reference is retained it would appear that only one instance is created if the the view reference is recreated, a duplicate is formed when the view is rendered.

The JSFiddle here demonstrates the issue hopefully. Obviously if there are a lot of views being used with many dropdownlists, then the capacity for many of these remnants to be created could be significant. I haven't done exhaustive testing, but this doesn't seem to happen for (for example) the grid.

Grateful for any assistance!

Many thanks,

J.

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 07 Jun 2013, 10:53 AM
Hello Jamie,

 
Every dropdownlist widget places its popup element in the body by default. The showIn method will detach only the view element and it is expected for the popup element to be left in the body. If you are going to show the hidden view at later moment, then the left popup should be not a problem. If you want to destroy the view then you can do something like this.

Regards,

Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
DropDownList
Asked by
Jamie
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or