Disconnect between modified DOM sourced data and custom render function.

Disconnect between modified DOM sourced data and custom render function.

asmxyzasmxyz Posts: 2Questions: 1Answers: 0
edited February 2024 in Free community support

Hello, I'm using data tables for a small project but having trouble with modifying a cell that should use a custom renderer with DOM sourced content.
If the data is in the DOM on page load and table initialization then the custom render function is used, but if I update the table cell via DOM manipulation then the custom render method is not called.

I have a datetime column that I want to contain the full datetime for sorting purposes, but I want to display a shortened friendlier version in the table. I defined the column with columns: [{data: "notified", type: "date", render: renderDate}].

In my Javascript handling the table update if I use dataTable.row("selector").data().notified = updatedDate then the data is never displayed in the table and is lost on a call to invalidate.
If I poke the data into the DOM and call invalidate then the data is in the table but the renderDate custom render function is never called with type = 'display' and the table displays the raw ISO8601 timestamp. This only seems to be an issue with updating a single cell in a table row. Add/remove of whole rows works great.

Am I missing something obvious? Thanks!

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.