Display custom message in jquery datatable when loading data?

I have the code below in jsp to create a dataTable. I use bProcessing as true, which displays a processing indicator until I get data from the server. I want to show the message as "load data .." instead of "processing". I tried using sProcessing, as suggested on different sites, but it does not work?

customersTable = $('cutomer').dataTable({ "sAjaxSource": "ajax url", "bProcessing":true, "bDeferRender": true, "sServerMethod": "POST", "oLanguage": { "sProcessing": "loading data..." } }); 
+4
source share
2 answers
  "oLanguage": { "sProcessing": "loading data..." } 

works for me and is also offered in dataTable Api http://datatables.net/ref . Just check if you put the right place. Otherwise, you can also try fnPreDrawCallback and fnDrawCallback

+6
source

You can try sLoadingRecords instead of sProcessing, since sLoadingRecords is loading data, and sProcessing is sorting and searching for local data. Since you use server-side processing, I don’t think sLoadingRecords will work for you, but it can change the text for you. Let us know that this works for you.

Here is information about sLoadingRecords from the DataTables website.

When using Ajax data and during the first draw, when DataTables collects data, this message is displayed in an empty row in the table to indicate to the end user that the data is being downloaded. Please note that this parameter is not used when loading data on server processing, but only Ajax data with client processing.

And for sProcessing

The text that is displayed when the table processes a user action (usually a sort command or similar).

+5
source

All Articles