Hi,
I revisited the topic Row Header Styling - text alignment, which is now closed.
I successfully implemented the afterGetRowHeader
callback, and managed to apply custom styles to the headers.
The problem I am facing is that the recommended approach will change all the headers, whereas I only need to apply conditional styles to the headers of certain rows.
The only way I could do that is by having access to the table instance (as other callbacks do, e.g. afterChange
), so I could query certain custom properties of the row and then to apply the conditional styles.
However, the afterGetRowHeader
callback only provides the row number and the TH
header element. With that alone, I don’t have any further information about the table itself (e.g. how many rows the table has).
Ideally, I should be able to get access to the data source of the table when this callback is fired.
Is there any workaround for this?
This is how I register the hook:
objectAssign(this.tableOpts, {
...
afterGetRowHeader: afterSalesGetRowHeaderCallback
});
And this is how I implemented it:
protected static afterGetRowHeaderCallback(row: number, TH: Element) {
...
}
Best regards.
Nicolas