|
|
@ -90,6 +90,8 @@ class Demo extends React.Component { |
|
|
|
scroll: undefined, |
|
|
|
hasData: true, |
|
|
|
tableLayout: undefined, |
|
|
|
top: 'none', |
|
|
|
bottom: 'bottomRight', |
|
|
|
}; |
|
|
|
|
|
|
|
handleToggle = prop => enable => { |
|
|
@ -140,13 +142,6 @@ class Demo extends React.Component { |
|
|
|
this.setState({ hasData }); |
|
|
|
}; |
|
|
|
|
|
|
|
handlePaginationChange = e => { |
|
|
|
const { value } = e.target; |
|
|
|
this.setState({ |
|
|
|
pagination: value === 'none' ? false : { position: value }, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
render() { |
|
|
|
const { xScroll, yScroll, ...state } = this.state; |
|
|
|
|
|
|
@ -221,20 +216,36 @@ class Demo extends React.Component { |
|
|
|
<Radio.Button value="fixed">Fixed</Radio.Button> |
|
|
|
</Radio.Group> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item label="Pagination"> |
|
|
|
<Form.Item label="Pagination Top"> |
|
|
|
<Radio.Group |
|
|
|
value={this.state.top} |
|
|
|
onChange={e => { |
|
|
|
this.setState({ top: e.target.value }); |
|
|
|
}} |
|
|
|
> |
|
|
|
<Radio.Button value="topLeft">TopLeft</Radio.Button> |
|
|
|
<Radio.Button value="topCenter">TopCenter</Radio.Button> |
|
|
|
<Radio.Button value="topRight">TopRight</Radio.Button> |
|
|
|
<Radio.Button value="none">None</Radio.Button> |
|
|
|
</Radio.Group> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item label="Pagination Bottom"> |
|
|
|
<Radio.Group |
|
|
|
value={state.pagination ? state.pagination.position : 'none'} |
|
|
|
onChange={this.handlePaginationChange} |
|
|
|
value={this.state.bottom} |
|
|
|
onChange={e => { |
|
|
|
this.setState({ bottom: e.target.value }); |
|
|
|
}} |
|
|
|
> |
|
|
|
<Radio.Button value="top">Top</Radio.Button> |
|
|
|
<Radio.Button value="bottom">Bottom</Radio.Button> |
|
|
|
<Radio.Button value="both">Both</Radio.Button> |
|
|
|
<Radio.Button value="bottomLeft">BottomLeft</Radio.Button> |
|
|
|
<Radio.Button value="bottomCenter">BottomCenter</Radio.Button> |
|
|
|
<Radio.Button value="bottomRight">BottomRight</Radio.Button> |
|
|
|
<Radio.Button value="none">None</Radio.Button> |
|
|
|
</Radio.Group> |
|
|
|
</Form.Item> |
|
|
|
</Form> |
|
|
|
<Table |
|
|
|
{...this.state} |
|
|
|
pagination={{ position: [this.state.top, this.state.bottom] }} |
|
|
|
columns={tableColumns} |
|
|
|
dataSource={state.hasData ? data : null} |
|
|
|
scroll={scroll} |
|
|
|