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}} scroll={{y:300}}
height={40} height={40}
onRowClick={(record, index, indent) => { onRowClick={(record, index, indent) => {
this.setState({ console.log('currentIndex--'+index);
selectedRowIndex: 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} record={record}
expandIconAsCell={expandIconAsCell} expandIconAsCell={expandIconAsCell}
onDestroy={this.onRowDestroy} onDestroy={this.onRowDestroy}
index={fixedIndex} index={fixedIndex+lazyCurrentIndex}
visible={visible} visible={visible}
expandRowByClick={expandRowByClick} expandRowByClick={expandRowByClick}
onExpand={this.onExpanded} onExpand={this.onExpanded}

View File

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