Open CodersExpo opened 1 year ago
***Update on a work around for this issue**
You should be able to use JQuery to capture the scroll event in the right tables scrollable view and apply that to the left table.
// This is a bandage to fix a scroll issue on frozen tree tables, please remove this when primeng releases a fix
ngAfterViewChecked(): void {
setTimeout(() => {
let frozenTable = $('.p-treetable-frozen-view');
let unfrozenTable = $('.p-treetable-unfrozen-view');
let frozenTableScroller = frozenTable?.find('div.p-treetable-scrollable-body.p-scroller');
let unfrozenTableScroller = unfrozenTable?.find('div.p-treetable-scrollable-body.p-scroller');
if (frozenTableScroller && unfrozenTableScroller) {
unfrozenTableScroller.off('scroll');
unfrozenTableScroller.on('scroll', function () {
frozenTableScroller.scrollTop($(this).scrollTop());
});
}
}, 1);
}
// ------------- end -------------
Do you have plans to fix this?
Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:
Describe the bug
Setting up a treetable with frozen columns as defined here: https://primeng.org/treetable/scroll works.
However, if you add
scrollHeight="flex" [virtualScroll]="true" [virtualScrollItemSize]="34"
scrolling the rows up/down vertically does NOT scroll the fields in the frozen column, those fields just stay frozen. All rows (fields) should scroll vertically together. Scrolling side to side horizontally does still work. The columns will scroll and the frozen ones say in place.Environment
"dependencies": { "@angular/animations": "^15.1.2", "@angular/cdk": "^15.0.3", "@angular/common": "^15.1.2", "@angular/compiler": "^15.1.2", "@angular/core": "^15.1.2", "@angular/forms": "^15.1.2", "@angular/platform-browser": "^15.1.2", "@angular/platform-browser-dynamic": "^15.1.2", "@angular/router": "^15.1.2", "@angular/service-worker": "^15.1.2", "@fortawesome/angular-fontawesome": "^0.10.2", "@fortawesome/fontawesome-svg-core": "^1.2.36", "@fortawesome/free-brands-svg-icons": "^6.0.0", "@fortawesome/pro-regular-svg-icons": "^6.0.0", "@fortawesome/pro-solid-svg-icons": "^6.0.0", "angular-oauth2-oidc": "^15.0.1", "animate.css": "^3.7.2", "applicationinsights-js": "^1.0.21", "bootstrap": "^5.2.3", "font-awesome": "^4.7.0", "jquery": "^3.6.0", "karma-coverage": "^2.0.3", "ng-mocks": "^14.2.2", "ngx-toastr": "^16.0.2", "primeicons": "6.0.1", "primeng": "^15.2.0", "rxjs": "^7.8.0", "tslib": "^2.3.1", "xlsx": "^0.17.1", "zone.js": "~0.11.4" }
`