Frozen columns + virtual scroll broken in PrimeNG 10

UI Components for Angular
Post Reply
florin.manea
Posts: 6
Joined: 26 Apr 2014, 10:58

16 Sep 2020, 11:22

When I upgraded from PrimeNG 9 to 10 the frozen columns with virtual scroll went broke. See [https://stackblitz.com/edit/angular-fxbcfy]

florin.manea
Posts: 6
Joined: 26 Apr 2014, 10:58

17 Sep 2020, 11:02

I think the problem in due to the missspelling of class name (p-datatabe-virtual-scrollable-body instead of p-datatable-virtual-scrollable-body) in ScrollableView component.

Also one of the class selectors applied to cdk-virtual-scroll-viewport for the frozen view must have overflow: hidden. in the past version this was .ui-table-frozen-view .ui-table-scrollable-body, .ui-table-frozen-view .ui-table-virtual-scrollable-body

Code: Select all

    ngAfterViewInit() {
        if (!this.frozen) {
            if (this.dt.frozenColumns || this.dt.frozenBodyTemplate) {
                DomHandler.addClass(this.el.nativeElement, 'p-datatable-unfrozen-view');
            }

            let frozenView = this.el.nativeElement.previousElementSibling;
            if (frozenView) {
                if (this.dt.virtualScroll)
                    this.frozenSiblingBody = DomHandler.findSingle(frozenView, '.p-datatabe-virtual-scrollable-body');
                else
                    this.frozenSiblingBody = DomHandler.findSingle(frozenView, '.p-datatable-scrollable-body');
            }


Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests