提交 76aa90f6 编写于 作者: A afc163

update document for table selection change

上级 34f9ab05
......@@ -11,7 +11,7 @@
- 增加了一个高级搜索类型表单的[演示](http://ant.design/components/form/#demo-advanced-search-form)
- Dropdown 支持多级的下拉菜单。[演示](http://ant.design/components/dropdown/#demo-sub-menu)
- Table
- 新增 rowSelection.onChange 方法
- 新增 `rowSelection.onChange``rowSelection.selectedRowKeys`,完善选择功能
- 更新 dataSource 时,选中项现在会被清空。
- 修复一个全选框和禁用的选择项配合的问题。
- 组件和文档的样式小调整。
......
......@@ -12,32 +12,29 @@ import { Table, Button } from 'antd';
const columns = [{
title: '姓名',
dataIndex: 'name',
render: function(text) {
return <a href="#">{text}</a>;
}
}, {
title: '年龄',
dataIndex: 'age'
dataIndex: 'age',
}, {
title: '住址',
dataIndex: 'address'
dataIndex: 'address',
}];
const data = [{
key: '1',
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号'
address: '西湖区湖底公园1号',
}, {
key: '2',
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号'
address: '西湖区湖底公园1号',
}, {
key: '3',
name: '李大嘴',
age: 32,
address: '西湖区湖底公园1号'
address: '西湖区湖底公园1号',
}];
const App = React.createClass({
......@@ -58,7 +55,6 @@ const App = React.createClass({
}, 1000);
},
onSelectChange(selectedRowKeys) {
console.log('onSelectChange', selectedRowKeys)
this.setState({ selectedRowKeys });
},
render() {
......
......@@ -93,8 +93,9 @@ const columns = [{
| 参数 | 说明 | 类型 | 默认值 |
|------------------|--------------------------|-----------------|---------------------|---------|
| getCheckboxProps | 选择框的默认属性配置 | Function(record) | - |
| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | Array | [] |
| onChange | 选中项发生变化的时的回调,用户手动点选、换页、更新数据均会触发 | Function(selectedRowKeys) | - |
| getCheckboxProps | 选择框的默认属性配置 | Function(record) | - |
| onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - |
| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(record, selected, selectedRows) | - |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册