DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, and will add advanced interaction controls to any HTML table.

datatable官方网站

使用中加上正在加载的提示

var createProcessing = function(){
    var processingMessage = "";
    processingMessage += '<div >' + '正在加载中...' + '</div>'
    $("table.table").before(processingMessage);
}

var initDatatable = function(options) {

    options = $.extend(true, {
        // Or you can use remote translation file
        "processing": true,
        "ajax" : {
            beforeSend : function(){
                $("#dataTables_processing").show();
            },
            complete : function(){
                $("#dataTables_processing").hide();
            } 
        },
...

在ajax中加上beforesend 和 comeplete 然后加载前显示和隐藏加上的正在加载的div块,注意此块的id 样式都已经是插件写好的

参考方案

相关文章:

  • 2022-12-23
  • 2021-08-05
  • 2021-08-04
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
相关资源
相似解决方案