telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
464 stars 213 forks source link

Having two group columns with the same content breaks the layout #3854

Open mbechev opened 1 year ago

mbechev commented 1 year ago

Describe the bug Having two group columns with the same content breaks the layout of the Grid:

<kendo-grid-column-group title="Group 1" >
    <kendo-grid-column-group title="Group 2">
        <kendo-grid-column field="ProductName" title="Product Name"></kendo-grid-column>
        <kendo-grid-column field="UnitsInStock" title="Units In Stock"></kendo-grid-column>
    </kendo-grid-column-group>
</kendo-grid-column-group>

image

To Reproduce Steps to reproduce the behavior:

amariq commented 1 year ago

Workaround is basically this:

<kendo-grid-column-group title="Group 1" >
    <!-- >>> FIX -->
    <kendo-grid-column [width]="0" [hidden]="true"></kendo-grid-column>
    <!-- <<< FIX -->
    <kendo-grid-column-group title="Group 2">
        <kendo-grid-column field="ProductName" title="Product Name"></kendo-grid-column>
        <kendo-grid-column field="UnitsInStock" title="Units In Stock"></kendo-grid-column>
    </kendo-grid-column-group>
</kendo-grid-column-group>

Because of this code in ColumnGroupComponent:

public get colspan(): number {
    if (!this.children || this.children.length === 1) {
        return 1;
    }

   ...
}