How to make datatables doesn't show $NaN.N when null value
How to make datatables doesn't show $NaN.N when null value
ezrachen
Posts: 12Questions: 4Answers: 0
in DataTables
Hi
My code like:
@:{ data: "yield@(i.ToString())", render: $.fn.dataTable.render.number('', '.', 4, '%') },
When the cell is null, it will show "NaN", how to make it doesn't show anything ?
Thanks! Best Regards!
This discussion has been closed.
Answers
Could you try using the DataTables nightly from the downloads page please. It has an update to handle null data in the number renderer. You should also set
columns.defaultContent
to tell DataTables how to display null data.Thanks,
Allan
columns : [
{ data: "yield0", defaultContent: ".", render: $.fn.dataTable.render.number('', '.', 4, '%') }
]
but no effert
Could you link to the page you are using so I can debug it directly please?
Thanks,
Allan
Hi Allan
Sorry, I forget your message. My website is my company private website. Outer can't connect it. Are there another way to trace by myself ?
Could you use http://live.datatables.net , JSFiddle, CodePen or any other similar service to create a test page so I can debug it please?
Thanks,
Allan
Hi Allan
I have link to //live.datatables.net and past my html and js into it. And I can look out.
But I doesn't know how to save. So I just "Save as template".
Or you have mail, I mail the html page to you.
Thanks! Best Regards!
It will automatically save and you just copy / paste the URL.
Allan
Hi Allan
The URL is my company's private address. Outside can't arrive it. I have made a html file with all table data, and javascript code to wrapper the table by datatable. I can send the file to you by mail.
Thanks!
The URL should be something like http://live.datatables.net/bequgeje/1/edit if you have used http://live.datatables.net/
Hi Allan
I have found When render option is "render: $.fn.dataTable.render.number(',', '.', 4, '$')", the defaultContent option don't function.
Thanks!
That should be resolved with the 1.10.6 release. Although I can't say for certain without a test case to try it out myself with your data and configuration.
Allan
I can't find solution yet
@jartur - To what? Have you the same issue as described in this thread? If so, please follow the forum rules and post a link to a test page showing the issue.
Allan