upgrade rc-table for nested dataIndex and fix #1898

nested dataIndex https://github.com/react-component/table/issues/46
This commit is contained in:
afc163 2016-06-01 14:45:07 +08:00
parent af83b2aade
commit 28d0cf86ea
3 changed files with 13 additions and 9 deletions

View File

@ -76,19 +76,18 @@ const columns = [{
| footer | 表格底部自定义渲染函数 | Function(currentPageData) | | | footer | 表格底部自定义渲染函数 | Function(currentPageData) | |
| scroll | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{{ x: true, y: 300 }}` | Object | - | | scroll | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{{ x: true, y: 300 }}` | Object | - |
### Column ### Column
列描述数据对象,是 columns 中的一项。 列描述数据对象,是 columns 中的一项。
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|-----------|----------------------------|-----------------|---------| |-----------|----------------------------|-----------------|---------|
| title | 列头显示文字 | String or React.Element | | | title | 列头显示文字 | String or React.Element | - |
| key | React 需要的 key建议设置 | String | | | key | React 需要的 key建议设置 | String | - |
| dataIndex | 列数据在数据项中对应的 key | String | | | dataIndex | 列数据在数据项中对应的 key,支持 `a.b.c` 的嵌套写法 | String | - |
| render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return里面可以设置表格[行/列合并](#demo-colspan-rowspan) | Function(text, record, index) {} | | | render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return里面可以设置表格[行/列合并](#demo-colspan-rowspan) | Function(text, record, index) {} | - |
| filters | 表头的筛选菜单项 | Array | | | filters | 表头的筛选菜单项 | Array | - |
| onFilter | 本地模式下,确定筛选的运行函数 | Function | | | onFilter | 本地模式下,确定筛选的运行函数 | Function | - |
| filterMultiple | 是否多选 | Boolean | true | | filterMultiple | 是否多选 | Boolean | true |
| sorter | 排序函数,本地排序使用一个函数,需要服务端排序可设为 true | Function or Boolean | - | | sorter | 排序函数,本地排序使用一个函数,需要服务端排序可设为 true | Function or Boolean | - |
| colSpan | 表头列合并,设置为 0 时,不渲染 | Number | | | colSpan | 表头列合并,设置为 0 时,不渲染 | Number | |
@ -111,7 +110,6 @@ const columns = [{
| onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - | | onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - |
| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - | | onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - |
## 注意 ## 注意
按照 React 的[规范](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children),所有的组件数组必须绑定 key。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。 按照 React 的[规范](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children),所有的组件数组必须绑定 key。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。

View File

@ -427,6 +427,12 @@
table { table {
border-radius: 0 @border-radius-base 0 0; border-radius: 0 @border-radius-base 0 0;
} }
// hide expand row content in right-fixed Table
// https://github.com/ant-design/ant-design/issues/1898
.@{table-prefix-cls}-expanded-row {
color: transparent;
pointer-events: none;
}
} }
&&-scroll-position-left &-fixed-left { &&-scroll-position-left &-fixed-left {

View File

@ -61,7 +61,7 @@
"rc-slider": "~3.6.2", "rc-slider": "~3.6.2",
"rc-steps": "~2.1.3", "rc-steps": "~2.1.3",
"rc-switch": "~1.4.2", "rc-switch": "~1.4.2",
"rc-table": "~4.0.6", "rc-table": "~4.1.1",
"rc-tabs": "~5.9.1", "rc-tabs": "~5.9.1",
"rc-time-picker": "~1.1.4", "rc-time-picker": "~1.1.4",
"rc-tooltip": "~3.3.2", "rc-tooltip": "~3.3.2",