diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 9d7948a629d..86322ff5b11 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -3933,7 +3933,7 @@ export class RowToggler { } }) export class ResizableColumn implements AfterViewInit, OnDestroy { - @Input({ transform: booleanAttribute }) pResizableColumnDisabled: boolean | undefined; + _pResizableColumnDisabled: boolean | undefined; resizer: HTMLSpanElement | undefined; @@ -3949,6 +3949,31 @@ export class ResizableColumn implements AfterViewInit, OnDestroy { documentMouseUpListener: VoidListener; + @Input({ transform: booleanAttribute }) + set pResizableColumnDisabled(pResizableColumnDisabled: boolean | undefined) { + if (pResizableColumnDisabled === this._pResizableColumnDisabled) return; + + this._pResizableColumnDisabled = pResizableColumnDisabled; + if (isPlatformBrowser(this.platformId) && this.isEnabled()) + this.ngAfterViewInit(); + else if (this.resizer) { + this.renderer.removeChild(this.el.nativeElement, this.resizer); + if (this.resizerMouseDownListener) { + this.resizerMouseDownListener(); + this.resizerMouseDownListener = null; + } + + if (this.resizerTouchStartListener) { + this.resizerTouchStartListener(); + this.resizerTouchStartListener = null; + } + } + }; + + get pResizableColumnDisabled() { + return this._pResizableColumnDisabled; + } + constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, private renderer: Renderer2, public dt: Table, public el: ElementRef, public zone: NgZone) {} ngAfterViewInit() {