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带领大家来解决这个错误. 解决方法 打开控制面板→管 ...
随机推荐
- 洛谷 P1005 动态规划 大数
Problem Description 帅帅经常跟同学玩一个矩阵取数游戏:对于一个给定的n×m的矩阵,矩阵中的每个元素a(i,j)均为非负整数.游戏规则如下: 1 每次取数时须从每行各取走一个元素,共 ...
- Linux下的Memcache安装 和 安装Memcache的PHP扩展
一.首先安装服务端memcached 1.下载libevent与memcache软件包. 下载memcached: wget http://memcached.org/latestwget http: ...
- C语言十六进制转换成十进制:要从右到左用二进制的每个数去乘以16的相应次方
#include <stdio.h> /* 十六进制转换成十进制:要从右到左用二进制的每个数去乘以16的相应次方: 在16进制中:a(A)=10 b(B)=11 c(C)=12 d(D)= ...
- SAM:后缀自动机
好文转载 luoguP3804 代码: /* 定义.对给定字符串s的后缀自动机是一个最小化确定有限状态自动机,它能够接收字符串s的所有后缀. 对给定字符串s的后缀自动机是一个最小化确定有限状态自动机, ...
- 笔记-读官方Git教程(2)~安装与配置
小书匠 版本管理 教程内容基本来自git官方教程,认真都了系列的文章,然后对一些重点的记录下来,做了简单的归纳并写上自己的思考. 1.安装 在基于 Debian 的发行版上,使用 apt-get安装 ...
- linux安装sox,踩过坑的方法
参考文章 : https://blog.csdn.net/e_zhiwen/article/details/80037476 重新在源码中 执行一遍 ./configure --prefix=$HOM ...
- 【一起来烧脑】一步学会HTML体系
[外链图片转存失败(img-zk4xNuy1-1563431241992)(https://upload-images.jianshu.io/upload_images/11158618-4e9cac ...
- [转] Hadoop入门系列(一)Window环境下搭建hadoop和hdfs的基本操作
转自:https://blog.csdn.net/qq_32938169/article/details/80209083 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载 ...
- 利用Wireshark抓取并分析OpenFlow协议报文
OpenFlow 交换机与控制器交互步骤 1. 利用Mininet仿真平台构建如下图所示的网络拓扑,配置主机h1和h2的IP地址(h1:10.0.0.1,h2:10.0.0.2),测试两台主机之间的网 ...
- 开源JS图片裁剪插件
开源JS图片裁剪插件 一.总结 一句话总结: 要用点赞最高的插件,这样适用性最好,效果最好,出问题的概率也最低,这里电脑端和手机端都可以用的建议用 cropper.js 二.5款好用的开源JS图片裁剪 ...