Selected Row datatables does not work
Selected Row datatables does not work
Javilete
Posts: 1Questions: 0Answers: 0
Hello,
I am trying to add the functionality in my table to be able to select single rows and highlight the one selected.
I am using the following code but it seems that nothing happens, when I click on any row it does nothing, it does not add the class that I have specified.
This is the code:
$(document).ready(function(){
var $objTable = $('#dataTableCustomerSearch').dataTable({
'bJQueryUI' : true,
'bFilter' : true,
'bPaginate' : false,
'bInfo' : true,
'sScrollY': '250px',
'bScrollCollapse': true,
'bSort' : true,
'bAutoWidth' : false,
'oLanguage' : {
'sLengthMenu' : 'Show _MENU_ Entries',
'sEmptyTable' : 'No Entries',
'sZeroRecords': 'No Entries Found',
'sInfo' : 'Search Results: _TOTAL_ customers'
},
'sDom': 'T<"top"i>rt',
'oTableTools': {
'sSelectedClass': 'selectedRow',
'sRowSelect': 'single'
},
'aoColumnDefs': [
{ 'aTargets': [0], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [1], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [2], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [3], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [4], 'bSortable': true, 'bSearchable': true }
]
});
Can anyone tell me whether they had the same issue and how to solve it?
Thank you very much in advance.
Regards
I am trying to add the functionality in my table to be able to select single rows and highlight the one selected.
I am using the following code but it seems that nothing happens, when I click on any row it does nothing, it does not add the class that I have specified.
This is the code:
$(document).ready(function(){
var $objTable = $('#dataTableCustomerSearch').dataTable({
'bJQueryUI' : true,
'bFilter' : true,
'bPaginate' : false,
'bInfo' : true,
'sScrollY': '250px',
'bScrollCollapse': true,
'bSort' : true,
'bAutoWidth' : false,
'oLanguage' : {
'sLengthMenu' : 'Show _MENU_ Entries',
'sEmptyTable' : 'No Entries',
'sZeroRecords': 'No Entries Found',
'sInfo' : 'Search Results: _TOTAL_ customers'
},
'sDom': 'T<"top"i>rt',
'oTableTools': {
'sSelectedClass': 'selectedRow',
'sRowSelect': 'single'
},
'aoColumnDefs': [
{ 'aTargets': [0], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [1], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [2], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [3], 'bSortable': true, 'bSearchable': true },
{ 'aTargets': [4], 'bSortable': true, 'bSearchable': true }
]
});
Can anyone tell me whether they had the same issue and how to solve it?
Thank you very much in advance.
Regards
This discussion has been closed.