如何在jQuery Datatables分页中返回特定页面?
16lz
2021-01-22
I have a datable and "Edit" button in each row. When I click that button, /edit/ url opens. Everything is Ok until now. But if I need to go back to the datatable, it starts from the first page. What can I do for that?
我有一个数据和每行的“编辑”按钮。单击该按钮时,/ edit / url将打开。到目前为止一切都很好。但是,如果我需要返回数据表,它将从第一页开始。我能做些什么呢?
$('#table').dataTable({
"sDom" : 'rtFip>',
'fnDrawCallback' : function() {
$('input:checkbox, input:radio').checkbox();
},
'sPaginationType' : 'full_numbers',
"bServerSide" : true,
"sAjaxSource" : "{% url 'get_menu_list' %}"
});
4 个解决方案
#1
27
DataTables has option to store state in a cookie.
DataTables可以选择在cookie中存储状态。
$(document).ready(function() {
$('#example').dataTable( {
"stateSave": true
} );
} );
http://datatables.net/examples/basic_init/state_save.html
更多相关文章
- 9.1.4 前端 - HTML body标签 - 标题,段落,分割线,换行,特殊符号,列
- 如何通过多次单击在画布上显示多个箭头
- Jquery中的事件处理(自动触发事件,禁用按钮,悬停,失焦,滑动效果)
- 你能告诉为什么javascript函数没有在profile.php的提交按钮中执
- html5中点击按钮,改变按钮状态效果样式
- 单击链接中的复选框会导致以下链接——我如何避免这种情况?
- 我无法理解为什么我的代码中的单击选择文本
- 当锚标记被单击时,角值从一个页面传递到另一个页面
- 组合两个下拉菜单以确定提交按钮链接