本文介绍了在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.

原始问题:

我想显示处理消息每当我从DataTables中添加/删除记录时,请。我不使用服务器端处理,根据少数事件我删除/添加记录到DataTable。

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.

我尝试使用 bProcessing 作为 true sProcessing 可以自定义进度消息,但看起来它只适用于服务器端处理。没有服务器端处理,怎么能达到同样的效果?我如何显式地调用显示处理消息的函数?

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.

谢谢。

解决方案:


感谢@Robodude。

Solution :
DEMOThanks @Robodude.

推荐答案

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

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应该是ID.OF.YOUR.TABLE_processing

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:

这篇关于在jQuery DataTables中显示处理消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 16:48