nhn / tui.grid

🍞🔡 The Powerful Component to Display and Edit Data. Experience the Ultimate Data Transformer!
http://ui.toast.com/tui-grid/
MIT License
2.42k stars 394 forks source link

Pagination keeps displaying only page 1 #2052

Closed SooSooSooS closed 3 months ago

SooSooSooS commented 3 months ago

Summary I made an API call using DataSource, but the pagination section only shows page 1 continuously.

Since the total number of records is 100 and the perPage is set to 5, there should be 20 pages in total, but only page 1 is displayed.

Screenshots

Below is an example.

toast script

  grid = new tui.Grid({
    el: document.getElementById("grid"),  
    pageOptions: {
      perPage: 5
    },
    data: {
      initialRequest: true,
      api: {
        hideLoadingBar: false,
        readData: {
          url: '/api/test/list?pageNum=1&pageSize=5',
          method: 'GET',
        },
      },
  },
    columns: setGridColumns(),
    columnOptions: {
      minWidth: 94
    },
    bodyHeight: 530,
    rowHeight: 30,
    scrollX: true,
    scrollY: true
  });

response data

{
    "result": true,
    "data": {
        "contents": [
            {
                ...
            },
        {
                ...
            },
        ],
        "pagination": {
            "page": 1,
            "totalCount": 100
        }
    }
}

Version 4.21.17

Additional context Add any other context about the problem here.