Additional discussion for issue #11443

UI Components for Angular
Post Reply
Draco2K7
Posts: 1
Joined: 21 Apr 2022, 11:42

25 Apr 2022, 17:42

To keep the github clean I would like to discuss some issues regarding this https://github.com/primefaces/primeng/issues/11443 .

So instead of using colgroups with simple width, we need to use flex-grow, flex-shrink, flex-base, min-width and max-width to define the size of the columns. And this has to happen on all tds and ths in all variants?

This just don't seem any improvement.

We don't have a static frontend with a fixed set of columns and widths, where this would be an easy task.
The whole frontend we implement result in a completly configurable frontend. This means, you can create a whole frontend (including multiple tables within a view) without any progamming.

Then we have a header, a filter row and templated content. It is just unnecessary hard to set these 5 values in the right combination on all layers, while keep it simple for the configurator. They just want to set a width and don't need to understand how display flex works.

So now I have to think which combination of the 5 settings is right for the requirements of the configurator.
Maybe somethink like flex: 1 1 0, min-width: 100px, max-width: (100/column.length) + "%" might work for columns without fixed width. And flex: 0 0 x% min-width: x% max-width: x% might work for percentage values. I will try this.
But I think this is overly complicated.

Currently (12.0.x) all we need to do for all this is that:

Code: Select all

    <ng-template pTemplate="colgroup" let-columns>
        <colgroup>
            <col *ngFor="let column of columns" [style.width]="column.width ?? 'auto'">
        </colgroup>
    </ng-template>
I just don't see where this whole table-flex thing helps other than better frozen columns/rows.

And with using a max-width, is it possible to resize the column (with the pResizableColumn) over the max-width?
(after #10608 is fixed)

Maybe the max-width helps, I will try it in our main project, but I am quite annoyed that I used like 3 working days, just to get the table working as expeced again, while not beeing broken before. Without getting any new sexy feature, which are worth the work.
It would still have been better to release the "flex-table" as new component without breaking the old one. And/or make the old one deprecated for 1-2 versions.

We wanted to switch to Angular v13 and PrimeNG v13 to use some of the new components (tree-select) but now I am wasting half a week to fix something, that was not broken (at least for us)

Sorry for ranting, but I hope that you are overthinking the process for these kind of breaking changes.

PS: you should remove the colgroup template from the code, as it breaks the table completly if beeing used.
PPS: If you are interested how this whole configurated frontend works.

u2223549
Posts: 3
Joined: 17 Jan 2018, 12:04

25 May 2022, 13:51

I experience the same problem. Setting the width of column in percent of the whole table width or with em values or whatever changes completly with the new PrimeNg 13 release. In my opinion, setting a width value for a column is a missing feature of the table.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests