Get the current cell from within the render function

Get the current cell from within the render function

MayaGMayaG Posts: 1Questions: 1Answers: 0

Hi! I'd like to access the current's cells dom node in the render function in order to create a d3 plot for each cell. Is this possible? I tried something like

.dataTable( {
  "columnDefs": [ {
    "targets": 4,
    "data": "description",
    "render": function ( data, type, row, meta ) {
        console.log(this)
    }
  } ]
} );

But that's not quite right... Any help appreciated!!!

Answers

  • kthorngrenkthorngren Posts: 13,841Questions: 25Answers: 3,261

    See the columns.render docs for information about the function parameters. The data parameter will give you the value for the cell. This example shows how to render cell data into something more visual.

    Use columns.createCell to get the cell's node.

    Kevin

Sign In or Register to comment.