render function provided in columndefs not used when redrawing

render function provided in columndefs not used when redrawing

mhall1mhall1 Posts: 1Questions: 1Answers: 0

I apologize, this is an internal app that is still in development, so I cannot share a link to the site (and I don't have my own hosting to throw up a demo page).

We have it set up so when a user clicks the "Display" button, a new DataTable object is constructed, replacing the old one (after calling destroy() on it). When this happens, the render() function provided in the columndefs object is called to do value formatting, but the formatted value it returns is not used. Instead, the original value is displayed.

When the render() function is provided per column, as part of the columns object, it is used properly. These should have the same behaviour, no?

Answers

  • kthorngrenkthorngren Posts: 21,166Questions: 26Answers: 4,921

    These should have the same behaviour, no?

    The do have the same behavior.

    When this happens, the render() function provided in the columndefs object is called to do value formatting, but the formatted value it returns is not used. Instead, the original value is displayed.

    An example test case would be good to look at so we can see what is happening.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    If you can do that then please post your code. Maybe something obvious will stand out.

    Kevin

This discussion has been closed.