datatable: error on destroy if not initialized #1520

Closed
marob opened this Issue Dec 7, 2016 · 0 comments

Projects

None yet

2 participants

@marob
Contributor
marob commented Dec 7, 2016

I'm submitting a ...

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
http://plnkr.co/edit/SnRN2v3B3P4m949cKQm7?p=preview

Current behavior
When a datatable is destroyed while not initialized (in a hidden tab for example), listener destroy fails:

TypeError: this.documentColumnResizeListener is not a function
    at DataTable.ngOnDestroy (VM2521 datatable:1154)
    at Wrapper_DataTable.ngOnDestroy (VM4363 wrapper.ngfactory.js:51)
    at View_AppComponent1.destroyInternal (VM12249 component.ngfactory.js:621)
    at View_AppComponent1.AppView.destroy (VM2065 core.umd.js:9210)
    at View_AppComponent1.DebugAppView.destroy (VM2065 core.umd.js:9438)
    at ViewContainerRef_.remove (VM2065 core.umd.js:7162)
    at ViewContainerRef_.clear (VM2065 core.umd.js:7177)
    at NgIf.set [as ngIf] (VM2067 common.umd.js:1431)
    at Wrapper_NgIf.check_ngIf (VM2571 wrapper.ngfactory.js:18)
    at CompiledTemplate.proxyViewClass.View_AppComponent0.detectChangesInternal (VM4385 component.ngfactory.js:251)

Expected behavior
Do not fail...

Minimal reproduction of the problem with instructions
See above Plunkr (just open the console and click on the checkbox).

  • Angular version: 2.0.X
    Angular 2.2.1

  • PrimeNG version: 2.0.X
    PrimeNG 1.0.1

@Mrtcndkn Mrtcndkn pushed a commit that closed this issue Dec 9, 2016
@marob marob FIX #1520 af6d3e2
@Mrtcndkn Mrtcndkn closed this in af6d3e2 Dec 9, 2016
@cagataycivici cagataycivici self-assigned this Dec 12, 2016
@cagataycivici cagataycivici added this to the 1.1 milestone Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment