Rendering a price breaks hyperlink
Rendering a price breaks hyperlink
usedlens
Posts: 15Questions: 5Answers: 1
I have a column which either gives a price or a hyperlink message 'see website'
I don't need a price symbol, but it's missing the two decimal places without using
{ 'data': 'price', render: $.fn.dataTable.render.number( ',', '.', 2, '' ) },
If I do that it breaks the 'see website' hyperlink, because that is not a number...
So how do I manage this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Use
columns.render
as a function and an if statement to determine if thedata
parameter is a number. If it is then use$.fn.dataTable.render.number()
with chaineddisplay(data)
as shown in this thread or return the link.Kevin
Thank you @kthorngren Here is the working solution