Skip to content

Commit

Permalink
feat(Table): Table column event onCellClick enhancement.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 14, 2018
1 parent 72e3291 commit 2a79dbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/md/cn/table.md
Expand Up @@ -511,7 +511,7 @@ class Demo extends Component {

### Table Column

列描述数据对象,是 columns 中的一项,Column 使用相同的 API。
列描述数据对象,是 columns 中的一项,`Column` 使用相同的 API。

| 参数 | 说明 | 类型 | 默认值 |
|------ |-------- |---------- |-------- |
Expand All @@ -520,7 +520,7 @@ class Demo extends Component {
| fixed | 列是否固定,`left``right` | string | - |
| render | 生成复杂数据的渲染函数,参数分别为当前行的值,当前行数据,行索引,@return里面可以设置表格行/列合并 | Function(text, rowData, index) {} | - |
| className | 列的 className | string | - |
| onCellClick | 单元格点击回调 | Function(rowData, event) | - |
| onCellClick | 单元格点击回调 | Function(cellData, colNumber, rowNum, columnKey, rowData, ischecked, event) | - |

### Table rowSelection

Expand Down
2 changes: 1 addition & 1 deletion src/table/Tbody.js
Expand Up @@ -55,7 +55,7 @@ export default class Tbody extends Component {
const keyname = columns[i].key;
const attri = {};
if (renders[keyname] && renders[keyname].onCellClick) {
attri.onClick = renders[keyname].onCellClick.bind(this, item[keyname]);
attri.onClick = renders[keyname].onCellClick.bind(this, item[keyname], i, rownum, keyname, item, !!rowsChecked[rownum]);
}
if (renders[keyname] && renders[keyname].className) {
attri.className = renders[keyname].className;
Expand Down

0 comments on commit 2a79dbb

Please sign in to comment.