Question

FreedomUI - Format number in list view without commas

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 1

Like

1 comments

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.

Show all comments