在jQuery DataTables中显示处理消息

时间:2021-11-01 14:25:10

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.

原始问题:每当我从DataTables添加/删除记录时,我想在DataTables中显示处理消息。我没有使用服务器端处理,这取决于我删除/添加记录到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?

我尝试使用bProcessing作为true和sProcessing来提供自定义进度消息,但看起来它只适用于服务器端处理。如何在没有服务器端处理的情况下实现相同目标?如何显式调用显示处理消息的函数?

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

这是一个类似的例子,但它使用服务器端处理。

Thanks.


Solution :
DEMO Thanks @Robodude.

解决方案:DEMO谢谢@Robodude。

1 个解决方案

#1


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.

所以我嘲笑了这个例子,页面上有一个隐藏的div,其中包含“Processing ...”文本,我想象它的显示方式是在发送服务器处理的ajax之前控制的,它显示了它和当它完成时,它会隐藏它。当启用bProcessing并在满足其出现条件时控制其可见性时,我会检查您的桌面上是否有默认的隐藏div。

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

隐藏div的id应该是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

#1


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.

所以我嘲笑了这个例子,页面上有一个隐藏的div,其中包含“Processing ...”文本,我想象它的显示方式是在发送服务器处理的ajax之前控制的,它显示了它和当它完成时,它会隐藏它。当启用bProcessing并在满足其出现条件时控制其可见性时,我会检查您的桌面上是否有默认的隐藏div。

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

隐藏div的id应该是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