Quantcast
Viewing all articles
Browse latest Browse all 82132

How to select a specified row after initializing the datatable complete...

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.

Viewing all articles
Browse latest Browse all 82132

Trending Articles