The table does not work with reverse server pagination

Author: EgorTrutnevCreated Sep 14, 2026Updated Sep 14, 2026

Description

I have a Bootstrap table with server-side pagination and the ability to select a row via a checkbox. The table is updated with one new record every 30 seconds. If the user selects the last record in the table, waits 30 seconds, and then refreshes, the selected record will move to the next page. This is absolutely normal and predictable behavior.

But now I have a task to display to the user the exact page where the selected record currently is. To do that, I fixed my server-side logic. However, I found that when the server responds to bootstrap-table, you can’t forcibly change the page number.

For example, the user is on page 5, where they have selected the last record. But after 30 seconds, that record moves to page 6. In the server response to the table reload, it tells the user that they need to go to page 6—but in bootstrap-table this can’t be done without refreshing the table.

Here is the code that I’d like to make work.

<table
    id="MyTable"
    data-ajax="myTablePostAjax"
   ...
</table>
window.myTablePostAjax = params => {    
    $.post(`${urlData}?${$.param(params.data)}`).then(function (res) {
        res.total = res.pagination.totalRecords;
        res.pageNumber = res.pagination.page; // <-- this forces the table to display a specific page
        params.success(res);
    }).fail(function (res) {
        params.error(res);
    });
}

Source: wenzhixin/bootstrap-table