Hot to get ID of a newly added row in fnOnAdded
Hot to get ID of a newly added row in fnOnAdded
I use Datatables-Editable and I just implemented DataTables hidden row details ( http://www.datatables.net/release-datatables/examples/api/row_details.html ). That is, I can open a row by clicking an icon to display further information. Now, when I add a new row, I want that icon to be there at the same time the row gets created (I don't want to have to reload the whole page). I think I need to do something like:
[code]
$('#employees tbody tr#'+id).each( function () {
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );[/code]
in fnOnAdded. Problem is, I don't know how to pass the id to that function?
How do I pass the id to fnOnAdded? And is this the way to go or how should I solve the problem?
[code]
$('#employees tbody tr#'+id).each( function () {
this.insertBefore( nCloneTd.cloneNode( true ), this.childNodes[0] );[/code]
in fnOnAdded. Problem is, I don't know how to pass the id to that function?
How do I pass the id to fnOnAdded? And is this the way to go or how should I solve the problem?
This discussion has been closed.
Replies
[code]
fnOnAdded: function()
{
var newrowindex = oTable.fnGetPosition($(".last-added-row").closest('tr')[0]);
var newrowdata = oTable.fnGetData(newrowindex);
return true;
}
[/code]