This is all I'm using for datatable...
$("#resultsTable").dataTable({
dom:'Blfrtip',
buttons: [
'excelHtml5',
'csvHtml5',
'pdfHtml5'
],
"fnPreDrawCallback":function(){
$("#resultsTable").hide();
//alert("Pre Draw");
},
"fnDrawCallback":function(){
$("#resultsTable").show();
//alert("Draw");
},
"fnInitComplete":function(){
//alert("Complete");
}
});
But it adds 'odd' or 'even' to the class name of each row it seems, which I do not want. How can I get it to leave the class names alone?
The lengthChange option is used to specify whether the dropdown to change the number of rows per page is displayed or not. This dropdown is shown only when paging of the DataTable is enabled, as disabling it automatically removes the dropdown. A true value displays the dropdown and a false value removes it.
DataTables' server-side processing mode is a feature that naturally fits with Scroller. Server-side processing can be used to show large data sets, with the server being used to do the data processing, and Scroller optimising the display of the data in a scrolling viewport.
DataTables saves the state of a table (its paging position, ordering state etc). When the stateSave option is enabled, it can be restored when the user reloads a page, or comes back to the page after visiting a sub-page.
If you want to remove stripe classes globally, set the default options:
$.extend($.fn.dataTable.ext.classes, {
sStripeEven: '', sStripeOdd: ''
});
If you want to disable the classes during initialization:
$('#example').dataTable( {
"stripeClasses": []
} );
If you want to disable them on the table directly via data attributes:
<table data-stripe-classes="[]">
</table>
I added "stripeClasses": []
, but it didn't have any effect. I had to remove "table-striped" in the list of classes in the table element used to create this data table. For instance, if you have a list of classes like this:
<table class="display table table-striped table-bordered dt-responsive">
simply delete table-striped
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With