DataTable.NET 使用server-side processing
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的更多相关文章
- 解决方法: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 ...
- 解决IIS7中出现An error occurred on the server when processing the URL错误提示的方法
相信用过IIS7的朋友在调试程序的时候都遇到过下面这样的错误提示: An error occurred on the server when processing the URL. Please ...
- 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 ...
- 解决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 ...
- 解决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 ...
- iis7错误提示An error occurred on the server when processing the URL...
win7下面运行ASP程序总是出错,原来是站点配置的问题... 问题一:MS Jet引擎改变了临时目录的位置,但是又没有对临时目录的存取权限,导致数据库使用失败(因为sql问题,后改用access数据 ...
- 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 ...
- 解决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选项 ...
- 打开asp出现An error occurred on the server when processing the URL
分享到: 2013-01-21 15:38 提问者采纳 方法一 以管理员身份运行CMD,将目录定位到%windir%\system32\inetsrv\,然后执行appcmd set co ...
- Win7/8出现An error occurred on the server when processing the URL解决办法
使用的是win8系统搭建的本地服务器,win7使用的方法是相同的.如果你的系统是精简版的Win7/8,那么安装IIS7也有可能出现这问题.下面SJY带领大家来解决这个错误. 解决方法 打开控制面板→管 ...
随机推荐
- (转载) 从0开始搭建SQL Server AlwaysOn 第一篇(配置域控)
安装完之后别忘了还需要安装SSMS,这是坑爹的地方之二,干嘛不集成到SQL Server安装包里还要用户自己单独下载 下载地址:https://msdn.microsoft.com/en-us/lib ...
- [DUBBO] qos-server can not bind localhost:22222错误解决
问题描述 在启动dubbo-consumer工程时报错,信息如下: 2019-11-29 09:22:18.001 ERROR [RMI TCP Connection(2)-127.0.0.1] [o ...
- 【JS】知识笔记
一.JS文件位置 多个.JS文件最好合并到一个文件中,减少加载页面时发送的请求数量. 某个单独页面需要的js,最好放在HTML文档的最后,</body>之前,这样能使浏览器更快地加载页面. ...
- Linux中三种SCSI target的介绍之各个target的优劣
版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/scaleqiao/article/deta ...
- codevs 1792 分解质因数
1792 分解质因数 题目描述 Description 编写一个把整数N分解为质因数乘积的程序. 输入描述 Input Description 输入一个整数 N 输出描述 Output Descr ...
- 洛谷 P3258 [JLOI2014]松鼠的新家 题解
P3258 [JLOI2014]松鼠的新家 题目描述 松鼠的新家是一棵树,前几天刚刚装修了新家,新家有n个房间,并且有n-1根树枝连接,每个房间都可以相互到达,且俩个房间之间的路线都是唯一的.天哪,他 ...
- leetcode 712
这道题的思路:我是根据最长公共子序列的思路得来的. 最长公共子序列是: d[i][j]表示字符串s1前i个(0-i-1)字符,和字符串s2前j个(0-j-1)字符的最长公共子序列. 分情况讨论: 当s ...
- 洛谷P3964松鼠聚会
题目 题意:求最小的从某一个点到其余点的切比雪夫距离和. 将一个图中的\((x,y)\)坐标转到新坐标\((x+y,x-y)\)后,图中的曼哈顿距离就是新图中的切比雪夫距离, 证明:分类讨论, 1.\ ...
- SqrtTree学习笔记
散步的时候yy区间最值的不同分块做法,发现单点修改\(O(\sqrt{n})\)查询\(O(1)\)的做法不是很会? 于是yy了一个奇怪做法,写出来看看. 考虑查询的时候两端的散点可以用前后缀最值查出 ...
- windows下powershell的包管理工具
scoop github 开源地址:https://github.com/lukesampson/scoop 安装命令->powershell管理员模式下输入 Invoke-Expression ...