Null in json data
Null in json data
snunn
Posts: 17Questions: 5Answers: 0
The table doesn't seem to like: "updatedAt":null in json data. How do I handle the null case?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
columns: function(rowData) { return (rowData.updatedAt ===null)?"":rowData.updatedAt;}
oops, that should be (for the appropriate column)
columns: [{data: function(rowData) { return (rowData.updatedAt ===null)?"":rowData.updatedAt;}}]
For more information on using rendering functions see the rendering manual page.
You can also use the
columns.defaultContent
option to tell DataTables what to do with null data.Allan