defaultContent option not working.
defaultContent option not working.
jite eghagha
Posts: 2Questions: 0Answers: 0
I need to handle null and empty string values from my datasource. I used a cheat to get the results i want, i used the render option. But i must figure out why my default option isn't working.
The code below works for my table:
{
name: 'forms.Id',
orderable: true,
data: 'form.Id()',
responsivePriority: 10,
defaultContent : '-',
render: $.fn.dataTable.render.ko.computed(function(data) {
return (data !== null ? data : '-');
})
}
But i want this to work instead :
{
name: 'formSets.npdesId',
orderable: true,
data: 'formSet.npdesId()',
responsivePriority: 10,
defaultContent : '-',
render: $.fn.dataTable.render.ko.observable()
}
Any idea what is wrong with defaultContent ?
This discussion has been closed.
Replies
Hi @jite eghagha ,
defaultContent
is used when loading data from JSON, it's hard to say without seeing your code running. 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
Thanks Colin.
Turns out that my code works fine on Google Chrome, but not on Internet Explorer.