Add columns.type num-fmt custom order info
Add columns.type num-fmt custom order info
islamelshobokshy
Posts: 99Questions: 20Answers: 1
How can I add to columns.type type num-fmt more sorting data like a spacebar and a . for example? So it would sort something similar to 10 908.36 €?
This discussion has been closed.
Replies
Also how to tell it something like : ignore everything after a slash for example. As if I have
100.00 % / 31 qte
, I would it to treat this as a number 100.00 % and ignore everything after the/
. Thanks!HI @islamelshobokshy ,
If you want to ignore part of the cell data, the best bet would be to render it with
columns.render
and return a sanitised version fortype
sort
- that way you can strip it of anything you don't want and it'll just use the default searching. If you want to go down the route of custom sorting, you can create your own fairly easily - look at the existing example under here to get an idea of what to do.Cheers,
Colin
Could you please write to me an example of a returned
type
sort
sanitised version? As I have no idea how to do that, even after reading the full columns.render page And I also tried looking at the custom sorting, it seems quite complicated Isn't there a simple way to add 2 more things for it to take into consideration rather than doing something that complicated? I just want it to take spacebars and dots when it is looking at the string...This example here from that page is for type
display
:To change your string for
sort
, it would be very similar - you'd test forsort
, then manipulate and return the string to match the format you want.For simply having space for the thousands separator, you could use the internationalisation capabilities, the
language.thousands
.Cheers,
Colin
The thousands langage separator doesn't work, the sorting still doesn't take the space into consideration
As for the sorting I figured it out as you said (thanks!), I'll post it here for reference :