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

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

vudhvudh Posts: 1Questions: 0Answers: 0
edited June 2013 in DataTables 1.9
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.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    If you are using TableTools use the fnSelectRow function. If you aren't - link to a test case please: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    Allan
This discussion has been closed.