引导表页面刷新问题

时间:2020-02-17 07:25:41

标签: bootstrap-4 bootstrap-table

例如,我使用了引导表分页。我现在在第五页。我有一个删除操作。他是引导程序的模态框。如果我确认删除,他将发送ajax请求。成功后,我应该刷新我的页面,当我执行刷新时,页面返回到第一页,这完全不符合我们的经验,我希望找到一些解决方案,在此感谢图像描述enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

在删除之前,请使用$('#table').bootstrapTable('getOptions').pageNumber获取当前页码。然后,在ajax调用完成并且成功加载数据之后,使用$('#table').bootstrapTable('selectPage', {pageNumber})

设置页码。

相关链接:

https://bootstrap-table.com/docs/api/methods/#getoptions
https://examples.bootstrap-table.com/#methods/select-prev-next-page.html

相关问题