We are using about 3 DropDownList components inside a cardView kendo.ui.Window item. When the window is closed, we're calling the 'destroy' method for each of the contained DropDownList items.
The problem is that the following code is not removing all the DropDownList's related DIVS, that had been appended to the document body:
var dropdownlist = $("#dropdownlist").data("kendoDropDownList");
dropdownlist.destroy();
After some searching, we noticed the following comment at the documentation for the destroy method (from Telerik): Important: This method does not remove the DropDownList element from DOM.
Therefore, each time someone opens and closes our kendo's windows (card view), many DropDownList's divs are appended without being removed from DOM - this can cause serious performance issues at the DOM.
The appended DIVS that stay put at the DOM are - "k-list-container' and "k-animation-container for instance.
- How can I solve this problem?
- Is there a way to destroy each DropDownList's elements completely (include deleting all its related elements from DOM)?
- Is this problem relevant when we need to destroy other kendo.ui components? (such as combobox, dateTimePicker, Tooltip etc.) Since our kendo.ui card window also contains other basic kendo.ui components.
k-animation-container
has the id of the dropdown with-list
appended to it. (using your example:id="dropdownlist-list"
) – Epimenides