Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display processing message in jQuery DataTables

EDIT :
I want to use the default processing message feature provided by datatables but looks like it works only with server side processing. I am not using server side processing.


Original Question :
I want to display processing message in DataTables whenever I am adding / deleting records from DataTables. I am not using server side processing, depending on few events I delete / add records to DataTables.

I tried using bProcessing as true and sProcessing to give custom progress message but looks like it works only with server side processing. How can I achieve same with without server side processing? How can I explicitly call a function which displays processing message?

Here is a similar example but it uses server side processing.

Thanks.


Solution :
DEMO Thanks @Robodude.

like image 797
Ajinkya Avatar asked Jul 03 '12 13:07

Ajinkya


1 Answers

So I firebugged the example and there is a hidden div on the page that contains the "Processing..." text and the way I imagine display of it is controlled is right before the ajax for the server processing is sent, it shows it and when it's completed, it hides it. I would check to see if you have a default hidden div on your table when enabling bProcessing and control its visibility when the conditions for it appearing are met.

The id of the hidden div should be the ID.OF.YOUR.TABLE_processing

So now I'd create handlers for the different conditions that you need to account for much like the examples seen here:

http://datatables.net/release-datatables/examples/advanced_init/events_live.html

like image 86
RoboKozo Avatar answered Sep 28 '22 00:09

RoboKozo