简体   繁体   中英

How to dynamically set the height on just one header row in ag-grid for react

This method sets the height

gridApi.setHeaderHeight(height);

But the problem is it sets height for both header groups.

 (Header group spans entire width)<------------------------- height gets set here
                                                            
(Header1    | Header 2   | header 3)<------------------------ and height gets set here
------------------------------------
row data 1 | row data 2 | row data 3

How to set the height for just one header row

 (Header group spans entire width)
                                                            
(Header1    | Header 2   | header 3)<------------------------ This row one only
------------------------------------
row data 1 | row data 2 | row data 3

See example: https://codesandbox.io/s/ag-grid-practice-forked-py43m?file=/src/index.tsx

Click Expand, and see both column header groups expand in height.

I think that this is impossible. The following methods can be used, but they set the height for the entire line in the header. I think this is a rather strange design decision to increase the header for only one of the columns.

gridApi.setHeaderHeight(value) 
gridApi.setGroupHeaderHeight(value)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM