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

row templates, event-listeners, and garbage collection

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim R
Top achievements
Rank 1
Tim R asked on 15 Jan 2013, 09:09 PM
Knowing next to nothing about javascript garbage-collection, I ask the following:

If a row template attaches a function to a cell's click-event:

           <td onclick='foo(event)'>   ${population} </td>

are there any memory-management issues for the developer to be concerned about?  Does binding (and rebinding) of data from repeated sorting and grouping potentially cause such listeners to accumulate in memory, or are they automatically disposed of?  

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 17 Jan 2013, 11:07 AM
Hi Tim,

Basically in some old versions of IE (6/7) such click event can cause memory leaks because of their garbage collection pattern. I would suggest using delegate to attach such event handlers, for example using jQuery "On" method.

 Also for more information about JavaScript memory management you can check this article.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Tim R
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or