Getting id when deleting a row in Editor
Getting id when deleting a row in Editor
Hi all
I'm using Datatables Editor and when deleting a row I would like to get the id of the row that was deleted. In the table, I have a user_id for each row. I thought maybe the callback would work, like this
editor.on( 'remove', function ( e, json, data ) {
// get data.user_id and do something with it
} );
But that doesn't do anything except it says data is undefined. Is it even possible to the user_id for the row that was just deleted?
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think you will want to use
initRemoveto get the data. The data is an array so for the first item you will usedata[0].user_id.Kevin
Thanks.. to test this out, I've tried this (just to see if I can get the user_id) by clicking on a cell and then leaving the cell.
editor.on( 'preBlur', function ( e, json, data ) {alert( data[0].user_id );} );in firebug I get TypeError: data is undefined..so it still seems the data is undefined
preBlurhas onlyeas a parameter andremovehas onlye, jsonas parameters.initRemovehase, json, dataparameters.Kevin
Got it...thanks