row.data() which contains special characters
row.data() which contains special characters
Hi
I've searched through all I can to find an answer to this but getting nowhere fast.
In this test case, clicking on a table row outputs the row data as an array and exactly as you would expect, including the apostrophe in Ashton O'Malley.
However, in my own project, the row data is output to the console as an object and apostrophes are printing as their encoded value of '
The only difference in the two scenarios is that the data source in mine comes from a MySql database.
Why can't I decode the row data so that I see ' instead of '
?
Thanks for any help
This question has an accepted answers - jump to answer
Answers
I suspect your original data from the server has
'
. You can usecolumns.render
to and replace'
with'
. But then you will need to usecells().render()
to get the rendered data. Here is an updated example:http://live.datatables.net/vayeyeqa/1/edit
I only use
columns.render
to change the'
for Garrett Winters. It also usestoArray()
withcells().render()
to result in a JS array.Kevin
Thanks Kevin
I had managed to convince myself that the data from the server was already decoded and it was ' not
'
Thanks for waking me up!