if datatable is empty then it should show "No data available in table." by default , but it's not ?
if datatable is empty then it should show "No data available in table." by default , but it's not ?
mayureshdeshmukh
Posts: 2Questions: 1Answers: 0
I tried by many was but not succeded.
$('#example').dataTable({
"oLanguage": {
"sEmptyTable": "My Custom Message On Empty Table"
}
});
Also
$('#example').dataTable( {
"language": {
"emptyTable": "No data available in table"
}
} );
Also
$('#example').dataTable( {
"language": {
"infoEmpty": "No entries to show"
}
} );
Nothing worked !
Answers
Your first code snippet is using legacy for of the options. See the Legacy Conversion Guide for details. But it does work here:
http://live.datatables.net/moburipi/1/edit
The second and third code snippets work also. I combined them in this example:
http://live.datatables.net/meyehufa/1/edit
Please post a link to your page or a test case showing the issue so we can help debug.
Kevin
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
oLanguage
is the legacy form of thelegacy
option. You can only have one of them. One will overwrite the other.As I said we will need to see the problem to help debug. My examples show the options work so it is something specific to your solution.
Kevin