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

"Use Nested Chart" example

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 25 Jan 2016, 09:40 PM

I found the "How-To" guide "Use Nested Chart" very helpful for showing how to use kendo widgets inside one or more grid cells.

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/use-nested-chart

 

I would like to propose adding a note regarding how to cleanup these widgets if the data source changes. Since the "dataBound" event is fired each time the grid is refreshed, the charts are correctly updated. However, previous chart components are not destroyed, potentially leaking data. You can see this behavior by running the example in the dojo. If you put a breakpoint in the kendo chart's destroy() method and then change pages, the breakpoint is not hit.

The solution that I came up with is to also hook the "dataBinding" event and call kendo.destroy() if the action is a "rebind".

dataBinding: function(e) {
    if (e.action === 'rebind') {
        kendo.destroy(e.sender.table.find('tr'));
    }
}

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 28 Jan 2016, 10:14 AM
Hi Andrew,

Thank you for the suggestion - I forwarded it to the team for further discussion.

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