how hide duplicate row in 1 column with "rowCallback": function
how hide duplicate row in 1 column with "rowCallback": function
deeproject
Posts: 2Questions: 1Answers: 0
hi, i manage to detect duplicate value in 1 colomn , how to hide/remove until only one remain
please help me
my code as follow
$(document).ready(function() {
$('#example').DataTable({
dom: 'Blfrtip',
mark: false,
'pageLength': 15,
searchHighlight: true,
responsive: true,
"rowCallback": function( row, data, index ) {
var allData = this.api().column(1).data().toArray();
if (allData.indexOf(data[1]) != allData.lastIndexOf(data[1])) {
$('td:eq(1)', row).css('background-color', 'Yellow');
}
},
});
$('#filter').keyup(function(){
$('#example').DataTable().search($(this).val()).draw() ;
searchHighlight: true;
});
} );
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
Answers
This example from this thread is demonstrating that - take a look at the "aTiger" line,
Colin
thankyou , this solved my case