Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datatables , scrollable breaks with resizableColumns set to expand #2568

Closed
huineng opened this issue Apr 21, 2017 · 3 comments
Closed

Datatables , scrollable breaks with resizableColumns set to expand #2568

huineng opened this issue Apr 21, 2017 · 3 comments

Comments

@huineng
Copy link

huineng commented Apr 21, 2017

**I'm submitting a

[X ] bug report => Search github for a similar issue or PR before submitting

Current behavior

When doing a resize column option expand within a scrollable table , the resize breaks the scrolling and the table does not scroll no more

  • Angular version: 4.0.X
  • PrimeNG version: 4.0.X
  • Browser: [all

Expected behavior

The problem in my opinion is related to this code

 else if(this.columnResizeMode === 'expand').....

 if(this.scrollable) {
      this.scrollBarWidth = this.scrollBarWidth||this.domHandler.calculateScrollbarWidth();
      this.el.nativeElement.children[0].style.width = parseFloat(containerWidth) + this.scrollBarWidth + 'px';
      let colGroup = this.domHandler.findSingle(this.el.nativeElement, 'colgroup.ui-datatable-scrollable-colgroup');
      let resizeColumnIndex = this.domHandler.index(this.resizeColumn);
      colGroup.children[resizeColumnIndex].style.width = newColumnWidth + 'px';
                }

Solution

Omit this line and it will work

   //  this.el.nativeElement.children[0].style.width = parseFloat(containerWidth) + this.scrollBarWidth + 'px';

this line is overwriting the scrollWidth breaking the scrollable

@huineng
Copy link
Author

huineng commented Apr 21, 2017

#1551

@bmstambaugh-zz
Copy link

Same issue, but to add once resized the column headers and the column cells no longer line up.

@cagataycivici
Copy link
Member

Duplicate of 1551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants