Hello,
In the freedom UI section list view, is there a way to format a numeric field so that it shows without commas? The field is an integer field and meant to store an identification number and not a quantity, so we are looking for a way to apply a custom format for the column to just show the digits without commas.
We did try to use a text field, but it doesn't work well because the sorting and filtering treats it as text values.
In classic UI it seemed like there were ways to do this like the post below. Is there something equivalent for FreedomUI?
https://community.creatio.com/questions/change-display-format-section-l…
Like
Hello,
The only possible working way to achieve this was using this code in the section list handlers:
{ request: "crt.LoadDataRequest", handler: async (request, next) => { var allElements = document.getElementsByTagName("td"); for (var i = 0; i < allElements.length; i++) { if (allElements[i].className.indexOf("PDS_UsrIntegCol") != -1) { var valueToReplaceElement = allElements[i].getElementsByClassName("crt-data-table-cell-value ng-star-inserted")[0]; var valueToReplaceValue = valueToReplaceElement.innerText; valueToReplaceElement.innerText = valueToReplaceValue.replace(",", ""); } } return next?.handle(request); } }
you need to replace PDS_UsrIntegCol with PDS_your column code in the code to test. But - it works only on the initial section list load and also sometimes not triggered upon changing the sorting. If someone has a better approach on this topic please share your ideas.
Oleg Drobina,
Is this still the case in Freedom UI? The ability to specify that it should be displayed without thousands separators was available in Classic UI.
It would be very useful if we could specify some of these default formatting options on the entity as well - year fields will always want to be an integer but also want to prevent thousands separators for example, and having to modify every page schema that may display them is not great.