Set page number at first load not working

Set page number at first load not working

personapersona Posts: 13Questions: 3Answers: 1

Hi,

I need to set the page on the grid first load.

I initialize the grid with deferLoading = 0, then I set the page with the function myGrid.page(2) and call reload.

The grid don't respect my page 2 and loads the page 0, but in the next load, I set page 2 again and after call reload, the page 2 is loaded.

Why datatables are not respecting my first setting page() before the first load of data?

Thanks.

Answers

  • personapersona Posts: 13Questions: 3Answers: 1

    I saw the displayStart property option https://datatables.net/reference/option/displayStart
    and the displayStart API plugin (that it's deprecated).

    Setting the displayStart with number of elements instead the page number it's not an elegant solution for me (and I think for no one).

    It would be more logical set a page number instead of calculate the number of elements?

    There is another way to do this like my first post setting the page number?

    Thanks.

This discussion has been closed.