Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react'
- import {
- Grid,
- TableView,
- TableHeaderRow,
- PagingPanel,
- } from '@devexpress/dx-react-grid-material-ui'
- import {
- PagingState,
- } from '@devexpress/dx-react-grid'
- import { TableCell } from 'material-ui'
- const TableEnhance = ({ rows, columns, currentPage, pageSize, totalCount, changeCurrentPage, buttonsConfig, processButtons }) => (
- <Grid rows={rows} columns={columns}>
- <PagingState
- currentPage={currentPage}
- onCurrentPageChange={changeCurrentPage}
- pageSize={pageSize}
- totalCount={totalCount}
- />
- <TableView
- tableCellTemplate={({ row, column }) => {
- if (column.name === 'actions' && buttonsConfig.show) {
- return <TableCell>{processButtons(row)}</TableCell>
- } return undefined
- }}
- />
- <TableHeaderRow />
- <PagingPanel />
- </Grid>
- )
- export default TableEnhance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement