When elements are removed from the down the scope must be destroyed. Angular Kendo listens to the $destroy event and responds by removing any remaining event handlers as to minimize memory leaks.
Starting at this this method:
```
// Cleanup after ourselves
scope.$on( '$destroy',
widget.destroy();
});
```
I only have the minified version of kendo.all.js, but the destroy method goes a little like
```
destroy: function() {
this.wrapper.off(y).find("*").off(y);
this._popup && (this._selector.destroy(), this._popup.destroy());
this._selector = this._popup = this.wrapper = null;
h.fn.destroy.call(this)
}
```
The issue for me is the wrapper property is null by the time destroy is invoked. My guess is Angular and JQuery removes this element before kendo has the chance to do so.
8 Answers, 1 is accepted
This is fixed in the latest versions of Kendo UI Core (where the color picker is available). The latest internal builds (available to customers with a subscription) also contain the fix.
Regards,Alex Gyoshev
Telerik
The 2014.2.716 is the offical Q2 version that does not contain the bug fix. To obtain it, use the latest internal build.
Regards,Alex Gyoshev
Telerik
TypeError: Cannot read property 'destroy' of undefined
at N.ui.DataBoundWidget.extend.destroy (http://localhost:1391/Scripts/kendo/2014.2.909/kendo.all.min.js:22:31285)
at http://localhost:1391/Scripts/angular-kendo.js:214:28
at Scope.$broadcast (http://localhost:1391/Scripts/angular.js:12887:28)
at Scope.$destroy (http://localhost:1391/Scripts/angular.js:12545:14)
at Scope.$delegate.__proto__.$destroy (<anonymous>:812:29)
at cleanupLastView (http://localhost:1391/Scripts/AngularUI/ui-router.js:2243:26)
at updateView (http://localhost:1391/Scripts/AngularUI/ui-router.js:2269:11)
at eventHook (http://localhost:1391/Scripts/AngularUI/ui-router.js:2224:17)
at Scope.$broadcast (http://localhost:1391/Scripts/angular.js:12887:28)
at $state.transition.resolved.then.$state.transition (http://localhost:1391/Scripts/AngularUI/ui-router.js:1822:22)
Detected Kendo UI version: "2014.2.909"
I only see this error when moving away from a view that is using a grid with grouping or any sort of drag and drop enabled like column ordering.
From the error, it appears that the destroy method is being called on a destroyed widget. Using kendo.destroy instead of calling the widget's destroy method directly should remedy the problem. If it does not, provide a sample that shows the problem so that we may inspect it.
Please note that this issue diverges from this thread, as it appears that it is related to the grid, and not the colorpicker. Please open separate threads for separate issues.
Regards,Alex Gyoshev
Telerik
TypeError: Cannot read property 'wrapper' of undefined
Any help would be greatly appreciated!
Based on this information, it appears that the element instance is not retrieved. Please open a separate thread for this, attaching the POC so that we may take a look, or pasting the relevant code.
Regards,Alex Gyoshev
Telerik