antd#TablePaginationConfig TypeScript Examples

The following examples show how to use antd#TablePaginationConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Worklist.tsx    From slim with Apache License 2.0 6 votes vote down vote up
handleChange (
    pagination: TablePaginationConfig,
    filters: any
  ): void {
    this.setState({ isLoading: true })
    let index = pagination.current
    if (index === undefined) {
      index = 1
    }
    let pageSize = pagination.pageSize
    if (pageSize === undefined) {
      pageSize = this.state.pageSize
    }
    const offset = pageSize * (index - 1)
    const limit = pageSize
    console.debug(`search for studies of page #${index}...`)
    const searchCriteria: { [attribute: string]: string } = {}
    for (const dataIndex in filters) {
      if (filters[dataIndex] !== null) {
        searchCriteria[dataIndex] = filters[dataIndex][0].toString()
      }
    }
    this.fetchData({ offset, limit, searchCriteria })
    this.setState({ isLoading: false, pageSize: pageSize })
  }