add prop to disable pagination in table component

This commit is contained in:
Mikhail Mikheev 2019-09-04 14:43:41 +04:00
parent 4dc756398f
commit cd33d04481
1 changed files with 5 additions and 4 deletions

View File

@ -162,10 +162,11 @@ class GnoTable<K> extends React.Component<Props<K>, State> {
input: classes.white,
}
const sortedData = stableSort(data, getSorting(orderParam, orderByParam, orderProp), fixedParam).slice(
page * rowsPerPage,
page * rowsPerPage + rowsPerPage,
)
let sortedData = stableSort(data, getSorting(orderParam, orderByParam, orderProp), fixedParam)
if (!disablePagination) {
sortedData = sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
}
const emptyRows = rowsPerPage - Math.min(rowsPerPage, data.length - page * rowsPerPage)
const isEmpty = size === 0