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

Destroying tab content

1 Answer 303 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kai Schiffer
Top achievements
Rank 1
Kai Schiffer asked on 13 Sep 2012, 02:32 PM
Hi folks,

maybe my question is a bit un-kendoish but i am thinking about performance during the lifetime of an application. My users can open as many tabs as they wish and close them, too. When a tab is removed its elements are removed from the DOM. What happens to the event handlers attached to them? Are they automatically removed as well to allow garbage collection of the no-longer-pointed-to objects?

Every time a tab is opened its page is downloaded and its 'code-behind' script is loaded into memory. In the Visual Studio Cassini you can see that these scripts are never unloaded from memory. Probably the objects created in the scripts will stay in the interpreter's scope forever, as they are interrelated with each other. What would be the best strategy to keep those leaks small? Putting as few code into these scripts as possible is probably a good idea, but what else? Delete everything by hand? Or is there any way to unload a script?

All the best
Kai 

1 Answer, 1 is accepted

Sort by
0
Kai Schiffer
Top achievements
Rank 1
answered on 14 Sep 2012, 08:57 AM
Just read in the roadmap:
Destroy() Method for all widgets

All widgets will now provide a Destroy() method, which will completely remove all DOM elements created by a widget and its interactions. This is a key feature for enabling developers to build Single Page Applications (SPAs) with Kendo UI.


This sounds promising, and yes, I am buiding a SPA. Will the destroy() of a tab recursively destroy all contained widgets?

Greetings
Kai

Tags
TabStrip
Asked by
Kai Schiffer
Top achievements
Rank 1
Answers by
Kai Schiffer
Top achievements
Rank 1
Share this question
or