Select Event
Select Event

in DataTables 2
Debugger code (debug.datatables.net):
I would like to add a row to my table. I used this:
shippingTable.on('draw.dt', function (e) {
var newRow = '<tr><td class="dtr-control" tabindex="0"></td><td class="select-checkbox"></td><td>Ritiro al magazzino di Lamone Cleanlife</td><td></td><td></td></tr>';
$('#shippingaddr tbody').append(newRow);
});
Now, for the added line, the function does not work "select row".
Description of problem:
select: {
style: 'single',
info: false
},
does not work for the newly added row.
What can I do?
Answers
Don't do that. DataTables doesn't know anything about your newly added row since you are injecting it directly into the DOM and DataTables doesn't watch for external changes.
You need to add the row using the API if you want DataTables to "know" about it.
See this FAQ: I append a row to the table using DOM/jQuery, but it is removed on redraw..
Allan