删除和恢复数据表分页点击功能
Remove and Restore datatables pagination click functionality
我在一个网页上有一个数据表实例,该实例具有全数字分页。这包括第一个、上一个、下一个和最后一个按钮以及单独编号的按钮。
表中的每一行都有一个"编辑"链接。当我点击它时,我想禁用分页。当我单击"取消"按钮时,我想恢复分页功能。我可以很容易地完成第一部分,但我无法恢复分页单击功能。这是我的代码:
function ghostPage(state)
{
// In this method, 'state' will be either true or false
// If it's true, remove the click handler
// If it's false, restore the click handler
if(state)
{
$('#displayTable_paginate').find('a').each(function(e){
$(this).off('click');
})
}
else
{
$('#displayTable_paginate').find('a').each(function(){
$(this).on('click');
})
}
}
如果您想保存点击处理程序并稍后恢复,请尝试此操作。
function saveClickHander(){
var $this;
$('#displayTable_paginate').find('a').each(function(e){
$this = $(this);
$this.data().originalClick = $this.data("events")['click'][0].handler;
})
}
function ghostPage(state)
{
// In this method, 'state' will be either true or false
// If it's true, remove the click handler
// If it's false, restore the click handler
if(state)
{
$('#displayTable_paginate').find('a').each(function(e){
$(this).off('click');
})
}
else
{
var $this;
$('#displayTable_paginate').find('a').each(function(){
$this = $(this);
$this.on('click', $this.data().originalClick);
})
}
}
相关文章:
- 如何使用skip参数使用angular ui引导进行服务器端分页
- 如何通过引用var Using DataTables来进行分页或排序
- 使用CSS或JavaScript计算分页符的数量
- DataTables-创建自定义分页样式(加载更多样式)
- 使用ajax的服务器端分页&jQuery
- 分页:如何用AJAX加载第一个页面
- dataTables-如何自定义分页类型以显示最后一个页码后面的省略号,
- 不带jquery的全屏分页
- 更改组合框分页后,getValue和getRawValue返回相同的值
- jQuery简单分页
- 使用jQuery在表中分页
- jQuery分页下一页和上一页按钮在点击零或超过最后一页后失败
- 如何在具有分页功能的表格排序器中取消选中所有复选框
- 使用extJS中的分页功能对存储进行筛选
- Window.Print() 功能在 IE7 中中断,屏幕带有分页
- 删除和恢复数据表分页点击功能
- 通过AJAX将数据附加到jQuery数据表并没有使用数据表的分页和功能
- 为分页导航功能添加延迟
- 带分页的Ajax搜索功能
- 包含分页后,搜索功能无法工作