避免渲染“表格中没有可用数据”在Datatables中 [英] Avoid Rendering "No Data Available in the table" in Datatables

查看:653
本文介绍了避免渲染“表格中没有可用数据”在Datatables中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JQuery Datatables。当表格呈现时,它显示为表格中没有数据可用,并且在某个时候表格开始出现数据并且无数据可用。

I am using JQuery Datatables. When the table renders , it shows as "No Data Available in the table", and after sometime the table starts appearing with data and this "No data Available" goes.

我不希望这个没有数据可用,相反,如果出现像正在加载或请等待这样的东西会很好或没有任何东西可以解决我的问题。

I dont want this "No data available to come", instead if Something like "Loading " or "Please wait" appears that will be great or nothing comes that will solve my problem.

推荐答案

在此查看完整参考 - > https://datatables.net/reference/option/language 您要查找的属性是 loadingRecords emptyTable zeroRecords

Look here for complete reference -> https://datatables.net/reference/option/language the attributes you are looking for is loadingRecords, emptyTable and zeroRecords.

$("#example").DataTable({
  language: {
   emptyTable: "No data available in table", // 
   loadingRecords: "Please wait .. ", // default Loading...
   zeroRecords: "No matching records found"
  }
})

Angular dataTables:

Angular dataTables :

$scope.dtOptions = DTOptionsBuilder.newOptions()
  .withLanguage({
    emptyTable: "No data available in table", 
    loadingRecords: "Loading...",
    zeroRecords: "A different no matching records message"
  })

这篇关于避免渲染“表格中没有可用数据”在Datatables中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆