DataTables appending zeroes to the cell texts
DataTables appending zeroes to the cell texts
murlex
Posts: 3Questions: 1Answers: 0
I have an issue where the json data looks fine, but data tables seem to append zeroes (only to some rows). Here is a mockup of what I am talking about:
{
"nTr": "<tr role=\"row\" class=\"odd\"><td class=\"sorting_2\">123450</a></td><td>Husband0</td><td class=\"sorting_1\">Engineer0</td><td>United Kingdom0</td><td>John Doe0</td></tr>",
"anCells": ["<td class=\"sorting_2\">123450</td>", "<td>Husband0</td>", "<td class=\"sorting_1\">Engineer0</td>", "<td>United Kingdom0</td>", "<td>John Doe0</td>"],
"_aData": [{
"Country": "United Kingdom",
"City": "London",
"Owner": "John Doe",
"Private": {
"Role": "Manager",
"Title": "Husband",
"Id": 12345,
"Func": "Engineer",
},],
In the nTr and anCells, all fields are appended a 0 while the _aData doesnt have such trailing zeroes. Any pointers on how I can debug this?
This discussion has been closed.
Answers
Can you not show the actual json data?
Unfortunately the data is proprietary...and I can definitely confirm that the zeroes are not in the json data. I am trying to recreate the problem with a generic database. If I manage to recreate it, I will post the jsfiddle link to it.
Or use live.datatables.net
Might seem odd, but can you post a screenahot? So i can see the pattern of where its adding zeros
I don't have a screenshot of it, but if you see in the data I posted above, every single cell in nTr has a zero appended to it. I actually narrowed down the problem to a server side issue where the jsonpickle was creating an empty py/id only element instead of the usual py/object element. Once that was resolved, I no longer see the zeroes anymore.