Suppose i get empty data from server sometimes, i want to display No Data found message in DataTables?. How is this possible?
DataTable({bFilter: false, bInfo: false, paging: false}); It works fine.
function clear() Simply remove all rows of data from the table.
If you want to customize the message that being shown on empty table use this:
$('#example').dataTable( {
"oLanguage": {
"sEmptyTable": "My Custom Message On Empty Table"
}
} );
Since Datatable 1.10 you can do the following:
$('#example').DataTable( {
"language": {
"emptyTable": "My Custom Message On Empty Table"
}
} );
For the complete availble datatables custom messages for the table take a look at the following link reference/option/language
Later versions of dataTables
have the following language
settings (taken from here):
"infoEmpty"
- displayed when there are no records in the table"zeroRecords"
- displayed when there no records matching the filteringe.g.
$('#example').DataTable( {
"language": {
"infoEmpty": "No records available - Got it?",
}
});
Note: As the property names do not contain any special characters you can remove the quotes:
$('#example').DataTable( {
language: {
infoEmpty: "No records available - Got it?",
}
});
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