-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Frozen Columns support for Column Groups #107
Comments
Please provide a test code that we can run. |
I added just two rows of mock data to the github link I had provided.
and
|
We did this for PrimeNG lately and need to do some changes for PrimeReact as well, will do it for 1.0.2. |
Added headerColumnGroup and footerColumnGroup properties |
render() {
let headerGroup = <ColumnGroup>
<Row>
<Column header="Sale Rate" colSpan={4} />
</Row>
<Row>
<Column header="Sales" colSpan={2} />
<Column header="Profits" colSpan={2} />
</Row>
<Row>
<Column header="Last Year" field="lastYearSale" sortable={true}/>
<Column header="This Year" />
<Column header="Last Year" />
<Column header="This Year" />
</Row>
</ColumnGroup>;
let footerGroup = <ColumnGroup>
<Row>
<Column footer="Totals:" colSpan={3} />
<Column footer="$506,202" />
<Column footer="$531,020" />
</Row>
</ColumnGroup>;
let frozenHeaderColumnGroup = <ColumnGroup>
<Row>
<Column header="Brand" rowSpan={3} />
</Row>
</ColumnGroup>;
return (
<div>
<DataTable value={this.state.sales} headerColumnGroup={headerGroup} scrollable={true} frozenHeaderColumnGroup={frozenHeaderColumnGroup}
footerColumnGroup={footerGroup}
scrollHeight="200px" frozenWidth="200px" unfrozenWidth="600px">
<Column field="brand" frozen={true} />
<Column field="lastYearSale" />
<Column field="thisYearSale" sortable={true}/>
<Column field="lastYearProfit" sortable={true}/>
<Column field="thisYearProfit" sortable={true}/>
</DataTable>
</div>
</div>
);
} |
Hi @claudv, Thanks a lot for your report. On 7.0, I'll reimplement scrollable DataTables like in primevue; If the problem persists after 7.0, please reopen this issue. Best Regards, |
Hi, it looks like still not working or got broken on newer versions |
Same as above, seems like this is the cause https://github.com/primefaces/primereact/blob/master/components/lib/datatable/HeaderCell.js#L127-L134 since there are two header rows it assumes that the second row is for filtering (but is actually a second <Row>) and tries to get the <td> cell right below the frozen one using index in top <tr> element, but due to colSpan there is no element at that index in the <tr> below |
Something goes wrong with the column Name in my data grid when I use Frozen specification with Column Grouping. I have the first column repeated, but If I disable frozen config in my table it will be fine.
Code:
https://github.com/MPanahandeh/time-tracker
The text was updated successfully, but these errors were encountered: