keep pagination state on fnDraw()

后端 未结 2 1523
野的像风
野的像风 2021-02-13 15:07

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()

相关标签:
2条回答
  • 2021-02-13 15:23

    Have a look at this plugin which does what you want: http://datatables.net/plug-ins/api#fnStandingRedraw

    0 讨论(0)
  • 2021-02-13 15:28

    On http://datatables.net/ref the explanation for fnDraw says:

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

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

    0 讨论(0)
提交回复
热议问题