i want to select the 1st row by default in datatable and while i click other row that selected row

i want to select the 1st row by default in datatable and while i click other row that selected row

nandhinitnandhinit Posts: 2Questions: 1Answers: 0

i want to select the 1st row by default in datatable and while i click other row that selected row should be removed.how to do this

$('#identifier').DataTable({
"paging": false,
"ordering": false,
"info": false,
"searching": false,

            "initComplete": function( settings, json ) {
                $('#identifier tbody tr:eq(0)').click();

                $('.dataTables_scroll').find('.dataTables_scrollBody').jScrollPane({
                    hideFocus: true,
                    autoReinitialise: true
                });

onclick of table row-function here

$scope.canned=function(data,$event,index){

    $("#file-name").html($scope.path);

    $(".addselect").removeClass('selected');    


    $($event.currentTarget).addClass('selected');    


}
This discussion has been closed.