我正在使用当前版本的JQuery Datatable。我已经实现了服务器端处理。是否有任何方法可以放置我们自己的加载GIF而不是默认文本“处理中”?
以下是我的HTML代码:
<table id="table" class="table table-striped table-bordered table-hover display nowrap" cellspacing="0" width="100%">
<thead>
<tr bgcolor="#76b900">
<th> Request #</th>
<th>Description</th>
<th>Created By</th>
</tr>
</thead>
</table>
这是我的JS代码:
$('#table').DataTable({
"dom": '<"top"lB>rt<"bottom"ip>', // DataTable element position
"lengthMenu": [
[10, 25, 50, 100, 500],
[10, 25, 50, 100, 500]
], // page length options
"pageLength": 25, // default page length
"pagingType": "full_numbers", // pagination related buttons
"ordering": true,
"order": [
[0, "desc"]
],
"scrollX": true, // enables horizontal scrolling
"filter": true,
"responsive": true,
"serverSide": true,
"info": true, // control table information display field
"processing": true,
"stateSave": true, //restore table state on page reload,
"ajax": {
"url": Helper.baseUrl() + "Search/LoadData",
"type": "POST",
"datatype": "json",
"data": function(d) {
d.searchParams = searchFilters();
},
},
"columns": //Binds values fetched from the database to their respective columns
[{
"data": "RequestNo",
}, {
"data": "Description"
}, {
"data": "CreatedBy"
}],
});
更新
这是我针对 Processing 的更新的 JS 代码:
"language": {
"infoFiltered":"",
"processing": "<img src='~/Content/images/loadingNew.gif' />"
},
这个方法没有起作用。我是不是在引入路径的方式上有错误?