This seems like it'd be simple but it's proving otherwise. For some reason headerName
is converted to a string and so it can't be a function.
I've also tried various renderer
and headerComponent
functions but like I said, I just want to return a dynamic string, not override everything and have to re-implement it (such as with the case of a custom header component).
// I'm trying everything at this point, nothing renders out..
getHeaderCellTemplate: () => 'test 2',
headerCellTemplate: () => {
// What I actually want to achieve:
const currency = appModel.selectedCertificate().currency();
return currency ? `Total Value (${currency})` : 'Total Value';
},
headerCellRenderer: HeaderCellRenderer,
headerComponent: HeaderCellRenderer,
cellRenderer: () => 'test 7',
headerRenderer: () => 'test 9',
I know I could wrap the column def in a function, but this would be very inefficient as the column def would be re-created every render.
I expect this will work for you:
headerValueGetter: (params) => {
const currency = appModel.selectedCertificate().currency();
return currency ? `Total Value (${currency})` : 'Total Value';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With