How to select a specified row after initializing the datatable complete...
How to select a specified row after initializing the datatable complete...
vudh
Posts: 1Questions: 0Answers: 0
Hi all,
I created a datatable as follows:
$('#table').dataTable({
// some settings...
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).on("click", function (event) {
// set the row selected...
alert('aa');
});
},
"fnInitComplete": function () {
$('#table').find('tr:first').trigger('click');
}
});
My purpose is to set the first row selected and display 'aa' after the datatable initialized complete. Unfortunately, it doesn't work now...
However, when I click on the row then it works...
Any ideas for me?
Thanks in advance,
vudh.
I created a datatable as follows:
$('#table').dataTable({
// some settings...
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).on("click", function (event) {
// set the row selected...
alert('aa');
});
},
"fnInitComplete": function () {
$('#table').find('tr:first').trigger('click');
}
});
My purpose is to set the first row selected and display 'aa' after the datatable initialized complete. Unfortunately, it doesn't work now...
However, when I click on the row then it works...
Any ideas for me?
Thanks in advance,
vudh.
This discussion has been closed.
Replies
Allan