defaultContent option not working.

defaultContent option not working.

jite eghaghajite 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 ?

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    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

  • jite eghaghajite eghagha Posts: 2Questions: 0Answers: 0

    Thanks Colin.

    Turns out that my code works fine on Google Chrome, but not on Internet Explorer.

This discussion has been closed.