Reputation: 69
Has anyone put borders around there row groups to help make their grid easier to read? If so any guidance would be appreciated.
Upvotes: 1
Views: 1208
Reputation: 81310
You can use getRowStyle
to specify which rows you need to style. In your case, you can find if a row is a normal row or a row group by checking if RowNode.group
is true
.
AgGrid only use border-top
to style row border. border-bottom
of a row is actually the border-top
of the row below it which means you can style the border-bottom
of the row group visually by styling the border-top
of the first child in the group (RowNode.firstChild
).
Here is an example:
const getRowStyle = (params) => {
const { node } = params;
if (
(node.rowIndex !== 0 && node.group) ||
(!node.group && node.firstChild)
) {
return { borderTop: "pink solid 1px !important" };
}
}
Upvotes: 1