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: 20,276Questions: 26Answers: 4,765

    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.