on click not working after upgrade from datatables 1.9.4 to 1.10.4
on click not working after upgrade from datatables 1.9.4 to 1.10.4
David Grigglestone
Posts: 6Questions: 1Answers: 0
First post .. please bear with me!
I have a column definition in #mylist datatable thus:
{
// the export now button
mData: "name",
sClass: "text-center",
bSearchable: false,
bSortable: false,
mRender: renderExportNowColumn
}
with renderExportNowColumn defined as:
function renderExportNowColumn(data, type, row) {
return "<a class='btn btn-default btn-xs' data-toggle='tooltip' title='Export "" +
data +
"" now'><i class='fa fa-arrow-right'></i></a>";
}
I have a handler defined thus:
$('#mylist .btn').live('click', function() {
var record = mytable.fnGetData($(this).parents('tr')[0]);
alert(record.name);
});
When upgrading to 1.10.4 I have changed the .live() to .on() but can no longer get the handler to fire. Any thoughts?
The table cells render just as they did with 1.9.4.
This discussion has been closed.
Replies
What was the change you make to your jQuery live function? You probably want something like:
Allan
Doh! .. yup bad on() call .. thanks for quick response