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

TUI grid pagination not work as i expected #1865

Open WooMRhackerman opened 1 year ago

WooMRhackerman commented 1 year ago

Summary I made a datasource grid for simple test using demo code. But pagination is just made a single pagination not thing more. I think either my code is wrong or my json return is wrong.

Please check my code and point it out what went wrong with it.

Screenshots my grid code is


const grid = new tui.Grid({

      el: document.getElementById('grid'),

      data: {

        contentType: 'application/json',

        api: {

          readData: { url: '/admin/memberList', method: 'GET'}

        }

      },

      scrollX: false,

      scrollY: false,

      minBodyHeight: 200,

      rowHeaders: ['rowNum'],

      pageOptions: {

        perPage: 2

      },

      columns: [

        {

          header: '회원번호',

          name: 'no',

          hidden: true

        },

        {

          header: '아이디',

          name: 'id',

          sortable: true

        },

        {

          header: '패스워드',

          name: 'pwd',

          hidden: true

        },

        {

          header: '성명',

          name: 'name'

        },

        {

          header: '역할',

          name: 'role'

        }

      ]

    });

my json return value


{
  "result": true,
  "data": {
    "contents": [
      datas...
    ],
    "pagenation": {
      "page": 1,
      "totalCount": 7
    }
  }
}

Version tui-Grid 4.21.8 tui-Pagination 3.4.1

Additional context Add any other context about the problem here.