Naruto Naruto - 1 year ago 144
JSON Question

How to show empty data message in Datatables

Suppose i get empty data from server sometimes, i want to display No Data found message in DataTables?. How is this possible?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download