Closed giovstef75 closed 7 years ago
I was having the same issue and found this code in DataTable.js.
if (this.scrollable) {
var colGroup = this.domHandler.findSingle(this.el.nativeElement, 'colgroup.ui-datatable-scrollable-colgroup');
bodyCols = colGroup.children;
if (bodyCols) {
for (var i = 0; i < columns.length; i++) {
bodyCols[i].style.width = columns[i].offsetWidth + 'px';
}
}
}
I currently have multiple levels of headers. Generic top level date header, with children that are tied to actual keys (effective date, expiration date, etc). It seems the colGroup.children
length was equal to the number of actual headers tied to a field, where columns.length
was the total number of header columns I had. So the loop is going out of range of the array it's iterating on.
Did you fix the code in the datatable.js?
I have not. Been trying to get other features at my work done, and haven't had enough time to see if it's as easy as switching what it iterates over, or if that has other unknown effects yet. Hopefully get a chance later today to figure that out.
Got it. I asked because you wrote "I was having" so I thought you fixed that. Anyway I think fixing the code is a bit tricky, if you want to stay up to date with the primeng releases (they are far to be stable usually).
Yeah, currently I just removed the scrollable functionality from the datatable and will try to fix it later, or just have a scrollable container around the table if it's more complicated than I hope it to be.
Ok, tks.
Unable to replicate with 4.1.RC, please provide a test case based on plunkr below and we'll review again.
Title or subject of this issue is bit confusing. For me this issue occurs when scrollable table is used along with resizableColumns="true". With fixed width column this issue does not occur. Check ngAfterViewChecked function in datatable.js it calls initResizableColumns method for resizableColumns which in turn invokes the code written in the comments above. Vertical and horizontal scroll bars appear correctly with fixed width defined for every column.
have any one find any solution i am facing same issue
[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