避免渲染“表格中没有可用数据”在Datatables中 [英] Avoid Rendering "No Data Available in the table" in 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屋!