I’m part of a team working on a site for a client who has needs financial info displayed. We’re using the enhancedDataManagerBase handler to display multiple tabs and within some of those tabs we’re currently rendering the admin.dataHelpers.relatedRecordsDatatable viewlet.
We’ve been asked to include the currency symbol and format amounts with a comma to 2 decimal places e.g. £12,000.00
We’ve currently partly done this using formula fields such as formula="CONCAT('£', FORMAT(${prefix}approved_amount, 2))" but have a couple of issues.
The first is that we need to do this on a property that is another formula field with an aggregate function in it and the formatting formula property is unable to reference the aggregate formula property.
The second is that on the properties we do have working, the datatable sorting doesn’t work as it’s sorting alphabetically.
So given all that, is there any way using Preside to have greater control over the built in datatables to allow us to make use of things like the built-in currency formatting or ability to set a different sort property than the display one? We could create a new view and add a datatable to that but hoping there might be other options.
That’s perfect thanks! I hadn’t realised the renderer could be applied to the datatable so that’s much nicer than having to create a bunch of formula fields and it also works with the existing aggregate formula fields.