primefaces / primeui

Rich set of javascript-css only widgets
http://www.primefaces.org/primeui
278 stars 125 forks source link

Update stickyHeader width in _renderData function of puidatatable #226

Open StephenCWills opened 8 years ago

StephenCWills commented 8 years ago

Ran into issues where the stickyHeader would not resize when the puidatatable's width changed as the result of a scrollbar appearing or disappearing, for instance when the number of rows in the data table changes. This is sort of a blind change to force the stickyHeader to resize every time the data is rendered. There may be a better way.

StephenCWills commented 8 years ago

To replicate, apply "overflow-y: auto" to the style of the div containing the puidatatable. If there is enough data in the table to make the scrollbar appear, the sticky header's width will have been calculated incorrectly.

Here is a jsfiddle demonstrating the issue. http://jsfiddle.net/staphen/1ez0motc/