docs: Table - Selection&operation - English Translation (#3267)

* Table - Selection&operation - English Translation

* Table - Selection&operation - English Translation

* Update row-selection-and-operation.md

* Update row-selection-and-operation.md
This commit is contained in:
kvetoslavnovak 2016-10-02 02:41:53 +02:00 committed by Benjy Cui
parent 1ff8a020d1
commit d3667b8a58

View File

@ -18,13 +18,13 @@ To perform operations and clear selections after selecting some rows, use `rowSe
import { Table, Button } from 'antd';
const columns = [{
title: '姓名',
title: 'Name',
dataIndex: 'name',
}, {
title: '年龄',
title: 'Age',
dataIndex: 'age',
}, {
title: '住址',
title: 'Address',
dataIndex: 'address',
}];
@ -32,22 +32,22 @@ const data = [];
for (let i = 0; i < 46; i++) {
data.push({
key: i,
name: `李大嘴${i}`,
name: `Edward King ${i}`,
age: 32,
address: `西湖区湖底公园${i}号`,
address: `London, Park Lane no. ${i}`,
});
}
const App = React.createClass({
getInitialState() {
return {
selectedRowKeys: [], // 这里配置默认勾选列
selectedRowKeys: [], // Check here to configure the default column
loading: false,
};
},
start() {
this.setState({ loading: true });
// 模拟 ajax 请求,完成后清空
// ajax request after empty completing
setTimeout(() => {
this.setState({
selectedRowKeys: [],
@ -71,8 +71,8 @@ const App = React.createClass({
<div style={{ marginBottom: 16 }}>
<Button type="primary" onClick={this.start}
disabled={!hasSelected} loading={loading}
>操作</Button>
<span style={{ marginLeft: 8 }}>{hasSelected ? `选择了 ${selectedRowKeys.length} 个对象` : ''}</span>
>Reload</Button>
<span style={{ marginLeft: 8 }}>{hasSelected ? `Selected ${selectedRowKeys.length} items` : ''}</span>
</div>
<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
</div>