Display processing message in jQuery DataTables
Asked Answered
K

1

12

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.

Kerch answered 3/7, 2012 at 13:1 Comment(8)
You could try adding event handlers for the different actions that would trigger the message to be displayed. Much like the example here: datatables.net/release-datatables/examples/advanced_init/…Cosy
@Robodude: I want to display default progress message given by datatables. Showing progress message in alert will not a good idea. I checked available functions and couldnt find out function which displays progress message. Please check example I have mentioned in question, I am looking for the same.Kerch
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.Cosy
The id of the hidden div should be the ID.OF.YOUR.TABLE_processingCosy
@Robodude: Thanks man. Can you please post this as a answer. [If you want some points :) ]Kerch
@Karna: Demo link is not working, can you fix that please? I'm in a same situation and looking for a solution.Atkinson
@AbuHamzah: I have corrected it..Kerch
Thanks for the correct link and I'm trying to implement similar but no avail, please have a look at my question I posted here #27340315Atkinson
C
21

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

Cosy answered 3/7, 2012 at 18:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.