https://datatables.net/examples/server_side/simple.html

當頁面上要顯示的數據在10萬筆以上時,可以使用server-side processing. 這樣在change entries, paging, sorting的時候,會通過事先定義好的ajax去backend重新取得數

RadGridTable = $('#tbNKeywords')
.on( 'processing.dt', function ( e, settings, processing ) {
// paging or sorting .etc processing or not,
// processing will be true if processing finished.
$('#loading_overlay').css( 'display', processing ? 'block' : 'none' );
})
.on('xhr.dt', function ( e, settings, json, xhr ) {
// Ajax call back, add some code here...
if (json == null || json["success"] == false) {
$('#loading_overlay').css( 'display', 'none' );
}
})
.on( 'draw.dt', function () {
// check all rows if select-all checked
if($(".select-all").is(":checked")) {
CheckedAll = 1;
RadGridTable.rows().select();
} // reset select checkbox by saved selected row ids
RadGridTable.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
if (AllSelectedRowIds.includes(this.id()))
this.select();
} );
})
.on( 'page.dt', function () {
if (CheckedAll == 1)
return; // save selected row id when paging
var selectedRowIds = RadGridTable.rows( { selected: true } ).ids();
for (i = 0; i < selectedRowIds.count(); i++)
{
if (!AllSelectedRowIds.includes(selectedRowIds[i]))
AllSelectedRowIds.push(selectedRowIds[i]);
}
})
.on( 'click', 'tbody tr', function () {
if (CheckedAll == 1)
return false;
})
.DataTable({
"columns": [
{ "data": null },
{ "data": "Created_Date" },
{ "data": "xxxxxxxx" },
{ "data": "xxxxxxxx" },
{ "data": "xxxxxxxx" },
{ "data": "xxxxxxx" },
{ "data": "xxxxxxx" }
],
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0,
data: null,
defaultContent: ''
}],
select: {
style: 'multi',
selector: 'td:first-child'
},
order: [[ 1, 'desc' ]],
"paging": true,
"searching": false,
colReorder: false,
fixedHeader: true,
"processing": true,
"serverSide": true,
rowId: 'KeywordId',
     "language": {
"infoFiltered": "" // remove "(filtered from x total entries)" part from datatable footer information.
},
"dom": '<"top"flp<"clear">>rt<"bottom"ip<"clear">>',
"ajax": {
"url": "/common/service/xxxxxxxxHandler.ashx",
"type": "POST",
"data": function (d) {
d.action = "xxxxxxxxx";
d.data = JSON.stringify(xxxxxxx);
d.Id = <%=Id%>;
}
}
});

define dataTable頁面上的一些文字部分

https://datatables.net/reference/option/language

例如: 不想要顯示 "(filtered from x total entries)" 在 footer的部分

$(document).ready(function() {
$('#example').DataTable( {
"language": {
"infoFiltered": ""
}
} );
} );

DataTable.NET 使用server-side processing的更多相关文章

  1. 解决方法:An error occurred on the server when processing the URL. Please contact the system administrator

    在WINDOWS7或SERVER2008上安装了IIS7.5,调试ASP程序时出现以下错误: An error occurred on the server when processing the U ...

  2. 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法

    相信用过IIS7的朋友在调试程序的时候都遇到过下面这样的错误提示:    An error occurred on the server when processing the URL. Please ...

  3. asp IIS部署An error occurred on the server when processing the URL错误提示解决

    An error occurred on the server when processing the URL. Please contact the system administrator.If ...

  4. 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法

    在IIS7上配置一个asp程序,出现了一个错如提示: An error occurred on the server when processing the URL. Please contact t ...

  5. 解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the system administrator

    原文:解决IIS7运行ASP提示错误:An error occurred on the server when processing the URL. Please contact the syste ...

  6. iis7错误提示An error occurred on the server when processing the URL...

    win7下面运行ASP程序总是出错,原来是站点配置的问题... 问题一:MS Jet引擎改变了临时目录的位置,但是又没有对临时目录的存取权限,导致数据库使用失败(因为sql问题,后改用access数据 ...

  7. IIs 中运行asp程序出现“An error occurred on the server when processing the URL. Please contact the system administrator.”错误

    在个人的win08系统上使用IIs运行 asp程序结果出现了以下错误 An error occurred on the server when processing the URL. Please c ...

  8. 解决Windows server 2012 R2 系统使用IIS8浏览Asp程序出现"An error occurred on the server when processing the URL"错误

    进入IIS并将ASP里的“Send Error To Browser”设置为True后点击Appley保存即可 原因是IIS里的Asp设置禁用上当错误信息发送给浏览器,只要启用即可 如果没有Asp选项 ...

  9. 打开asp出现An error occurred on the server when processing the URL

    分享到:   2013-01-21 15:38   提问者采纳   方法一 以管理员身份运行CMD,将目录定位到%windir%\system32\inetsrv\,然后执行appcmd set co ...

  10. Win7/8出现An error occurred on the server when processing the URL解决办法

    使用的是win8系统搭建的本地服务器,win7使用的方法是相同的.如果你的系统是精简版的Win7/8,那么安装IIS7也有可能出现这问题.下面SJY带领大家来解决这个错误. 解决方法 打开控制面板→管 ...

随机推荐

  1. Hello 2019【A,B,C】

    #include<bits/stdc++.h> using namespace std; #define int long long signed main(){ string str; ...

  2. 洛谷 P1120 小木棍 dfs+剪枝

    Problem Description [题目链接] https://www.luogu.com.cn/problem/P1120 乔治有一些同样长的小木棍,他把这些木棍随意砍成几段,直到每段的长都不 ...

  3. RegularExpression正则表达式

    1.必須為大寫字母,小寫字母,數字和符號的至少其中3種組合 The new password should contain any three of different syntax which is ...

  4. Python学习之--字典

    一.字典的表示 字典用放在花括号{} 中的一系列键—值对表示,键—值对是两个相关联的值:键和值之间用冒号分隔,如circle = {'color':'green', 'points':5} 二.取值 ...

  5. GoCN每日新闻(2019-09-25)

    GoCN每日新闻(2019-09-25) 1. Go module 再回顾 https://colobu.com/2019/09/23/review-go-module-again/2. 如何灵活地进 ...

  6. 《挑战30天C++入门极限》C/C++中字符指针数组及指向指针的指针的含义

        C/C++中字符指针数组及指向指针的指针的含义 就指向指针的指针,很早以前在说指针的时候说过,但后来发现很多人还是比较难以理解,这一次我们再次仔细说一说指向指针的指针. 先看下面的代码,注意看 ...

  7. python find和index的区别

    如果找不到目标元素,index会报错,find会返回-1 >>> s="hello world" >>> s.find("llo&qu ...

  8. 标准ACL详解

  9. java本地与树莓派中采用UDP传输文本、图片

    今天解决了一个困扰好几天的问题,由于比赛需要,需要用java语言,并采用UDP传输协议,让树莓派与服务器(就是本机)建立连接传输视频,图片. 由于UDP是建立在无连接的协议上,因此就碰到了一个很尴尬的 ...

  10. vue入门|ElementUI使用指南

    vue入门|ElementUI使用指南 1.开发前务必熟悉的文档: vue.js2.0中文,项目所使用的js框架 vue-router,vue.js配套路由 vuex 状态管理 Element UI框 ...