primeng icon indicating copy to clipboard operation
primeng copied to clipboard

PrimeNG 13 colgroup is not working when scrollable property is turned on

Open csmark97 opened this issue 4 years ago • 4 comments

I'm submitting a

[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
[x] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports) https://stackblitz.com/edit/primeng-tablecolgroup-demo-fpgcts

Current behavior If I turn on the scrollable property, the colgroup is not working.

Expected behavior The colgroup should also work with scrollable table.

Minimal reproduction of the problem with instructions I created a button which is toggle the scrollable property. You can see the header is going to pieces.

What is the motivation / use case for changing the behavior? We want to create a scrollable table with colgroups using rowspan/colspan. We were able to do it earlier with PrimeNG 11.

  • Angular version: 13.1.1

  • PrimeNG version: 13.0.4

  • Browser: Chrome

csmark97 avatar Jan 07 '22 16:01 csmark97

I think the combination of that with the change to make scrollable tables to have display flex is increasing the usual upgrade time of 1-2 days to nearly 2 weeks given we need to look into individual components and there is not one fix for all components.

We were using colgroup as a way to set the width for the columns, but once scrollable is configured, that is not observed. I think the recommendation for setting width now is to set on both th and td columns.

gustavobmichel avatar Jan 11 '22 10:01 gustavobmichel

Hi,

You need to use 'headergrouped' template instead of 'header' template.

<ng-template pTemplate="headergrouped"...

yigitfindikli avatar Jan 12 '22 07:01 yigitfindikli

is this "headergrouped" template documented anywhere?

dcanning avatar Jun 30 '22 17:06 dcanning

@dcanning

Yes, you can see on this page: http://primefaces.org/primeng/table.

Search for "headergrouped".

In Column grouping section: "Columns can easily be grouped using templating. Let's start with sample data of sales of brands per year. Note that if you use Scrollable table should be used headergrouped and footergrouped templates instead of header and footer templates."

csmark97 avatar Jul 01 '22 09:07 csmark97