在fnDraw()上保持分页状态 [英] keep pagination state on fnDraw()

查看:86
本文介绍了在fnDraw()上保持分页状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用jquery数据表.我的pagination有问题,使用this.table.dataTable().fnDraw()时它正在重置.

I am using jquery datatables in my application. I have a problem with my pagination, it is resetting when I use this.table.dataTable().fnDraw().

每5秒钟,我的数据表在更新表时都会调用fnDraw().调用this.table.dataTable().fnDraw()时,即使用户在第2页或其他页面上,也会显示第一页.

For every 5 seconds my datatable calls fnDraw() while updating the table. When this.table.dataTable().fnDraw() is called first page is displayed, even if the user is on page 2 or other.

是否有一种方法可以保持分页状态,即使在this.table.dataTable().fnDraw()之后也是如此.

Is there an way to keep the pagination state even after this.table.dataTable().fnDraw().

推荐答案

http://datatables.net/ref fnDraw的解释说:

Parameter:  fnDraw
Type:       function
Inputs:     {bool} [default=true]: Re-filter and resort 
            (if enabled) the table before the draw.

因此,只需尝试this.table.dataTable().fnDraw(false)即可.停留在同一页面上,排序也保持不变.

So, just tried this.table.dataTable().fnDraw(false) and it worked. Stayed on the same page and also sorting stayed the same.

这篇关于在fnDraw()上保持分页状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆