Dandelion Datatables + Thymleaf + dt:format

600 views Asked by At

I've tried to implement the formatting attribute for Dandelion Datatables as specified here using Thymeleaf to no avail, like so:

<table dt:table="true" dt:serverside="true" dt:url="@{/somefnplace}">
    <thead>
        <tr>
            <th dt:property="someCurrencyField" dt:format="{0, number, #.##}">
        </tr>
    </thead>
</table>

...but this does not do anything. Anyone got an idea on how this is supposed to work, or do I have to create render functions for every column because this feature is broken?

1

There are 1 answers

0
tduchateau On BEST ANSWER

Unfortunately, the dt:format attribute is not compatible with AJAX sources. See the last column of the link you've mentioned.

In the upcoming version, it will simply be removed, because using DOM sources, expression utility objects meet all needs perfectly.

So yes, currently the only way is to use the dt:renderFunction attribute, which will refer to a rendering function, one for each column to need to display in a specific format.