Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid Rendering "No Data Available in the table" in Datatables

I am using JQuery Datatables. When the table renders , it shows as "No Data Available in the table", and after sometime the table starts appearing with data and this "No data Available" goes.

I dont want this "No data available to come", instead if Something like "Loading " or "Please wait" appears that will be great or nothing comes that will solve my problem.

like image 301
Atul kumar singh Avatar asked May 31 '26 19:05

Atul kumar singh


1 Answers

Look here for complete reference -> https://datatables.net/reference/option/language the attributes you are looking for is loadingRecords, emptyTable and zeroRecords.

$("#example").DataTable({
  language: {
   emptyTable: "No data available in table", // 
   loadingRecords: "Please wait .. ", // default Loading...
   zeroRecords: "No matching records found"
  }
})

Angular dataTables :

$scope.dtOptions = DTOptionsBuilder.newOptions()
  .withLanguage({
    emptyTable: "No data available in table", 
    loadingRecords: "Loading...",
    zeroRecords: "A different no matching records message"
  })
like image 55
davidkonrad Avatar answered Jun 03 '26 09:06

davidkonrad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!