Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35273

fnRowSelected is not working as expected

$
0
0

Hi friends,

Please find my code below. I am not sure why fnRowSelected is not working. I am not getting any alert while selecting a row.

Any help on this very much appreciated.

try
                {

                    var pdlJsonObj = output.aaData;

$('#divDataTable').dataTable(
{
"aaData": pdlJsonObj,
"bDestroy": true,
"sPaginationType": "full_numbers",
"bPaginate": true,
"bFilter": true,
"aLengthMenu": [
[5, 10, 25, 50],
[5, 10, 25, 50]
],
"bFilter": true,
"aaSorting": [],
"tableTools": {
"sRowSelect": "single",
"fnRowSelected": function ( node ) {
alert( 'The row with ID '+node[0].id+' was selected' );
}
},
"fnCreatedRow": function (nRow, aData, iDisplayIndex, iDisplayIndexFull)
{

                                    $(nRow).attr('id', iDisplayIndex);
                                    },
                     "fnInitComplete": function ()
                                    {
                            $('#divDataTable tbody tr').find('td').removeClass('markrow'); //To Remove Highlight from Other Rows when we select a row
                                      $("#divDataTable tbody tr:eq(0)").find('td').each(function ()
                                          {
                                            $(this).addClass("markrow");
                                           });
                            }

                    });

                }

                catch(err)
                {
                    alert(err.message);
                    // document.getElementById('divLoading').innerHTML = err.message;
                }

            });

Thanks
Shaji


Viewing all articles
Browse latest Browse all 35273

Trending Articles