bigData场景下事件中index值问题

This commit is contained in:
wanghaoo 2018-12-26 16:55:06 +08:00
parent c8963e3bdf
commit 615baf482d
6 changed files with 13 additions and 18 deletions

View File

@ -90,9 +90,7 @@ class Demo30 extends Component {
scroll={{y:300}}
height={40}
onRowClick={(record, index, indent) => {
this.setState({
selectedRowIndex: index
});
console.log('currentIndex--'+index);
}}
/>

File diff suppressed because one or more lines are too long

17
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -567,7 +567,7 @@ class Table extends Component {
record={record}
expandIconAsCell={expandIconAsCell}
onDestroy={this.onRowDestroy}
index={fixedIndex}
index={fixedIndex+lazyCurrentIndex}
visible={visible}
expandRowByClick={expandRowByClick}
onExpand={this.onExpanded}

View File

@ -87,7 +87,7 @@ class TableRow extends Component{
setRowHeight() {
const { setRowHeight , expandedContentHeight=0,lazyCurrentIndex=0,fixed} = this.props
if (!setRowHeight || !this.element || fixed) return
setRowHeight(this.element.clientHeight + expandedContentHeight, this.props.index+lazyCurrentIndex)
setRowHeight(this.element.clientHeight + expandedContentHeight, this.props.index)
}
onRowClick(event) {
@ -189,7 +189,7 @@ class TableRow extends Component{
record={record}
indentSize={indentSize}
indent={indent}
index={index+lazyCurrentIndex}
index={index}
column={columns[i]}
key={columns[i].key}
fixed= {fixed}