From 9cacc8a5abe6a440657e1b1c62405b342a11758f Mon Sep 17 00:00:00 2001 From: pana Date: Wed, 11 Jan 2017 19:23:03 +0800 Subject: [PATCH 1/2] multigrid support onScroll --- source/MultiGrid/MultiGrid.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/MultiGrid/MultiGrid.js b/source/MultiGrid/MultiGrid.js index f559297d2..b7efa1944 100644 --- a/source/MultiGrid/MultiGrid.js +++ b/source/MultiGrid/MultiGrid.js @@ -423,7 +423,8 @@ export default class MultiGrid extends Component { fixedRowCount, rowCount, scrollToColumn, - scrollToRow + scrollToRow, + onScroll } = props return ( @@ -433,7 +434,7 @@ export default class MultiGrid extends Component { columnCount={columnCount - fixedColumnCount} columnWidth={this._columnWidthRightGrid} height={this._getBottomGridHeight(props)} - onScroll={this._onScroll} + onScroll={(info) => {this._onScroll(info);onScroll && onScroll(info)}} ref={this._bottomRightGridRef} rowCount={rowCount - fixedRowCount} rowHeight={this._rowHeightBottomGrid} From 8b74fc6c84455c707f6692c1a916cba76c6300d5 Mon Sep 17 00:00:00 2001 From: pana Date: Thu, 12 Jan 2017 09:42:47 +0800 Subject: [PATCH 2/2] update multigrid onScroll --- source/MultiGrid/MultiGrid.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/MultiGrid/MultiGrid.js b/source/MultiGrid/MultiGrid.js index b7efa1944..c9291d107 100644 --- a/source/MultiGrid/MultiGrid.js +++ b/source/MultiGrid/MultiGrid.js @@ -381,11 +381,16 @@ export default class MultiGrid extends Component { } } - _onScroll ({ scrollLeft, scrollTop }) { + _onScroll (scrollInfo) { + const {scrollLeft, scrollTop} = scrollInfo this.setState({ scrollLeft, scrollTop }) + const onScroll = this.props.onScroll + if (onScroll) { + onScroll(scrollInfo) + } } _renderBottomLeftGrid (props) { @@ -423,8 +428,7 @@ export default class MultiGrid extends Component { fixedRowCount, rowCount, scrollToColumn, - scrollToRow, - onScroll + scrollToRow } = props return ( @@ -434,7 +438,7 @@ export default class MultiGrid extends Component { columnCount={columnCount - fixedColumnCount} columnWidth={this._columnWidthRightGrid} height={this._getBottomGridHeight(props)} - onScroll={(info) => {this._onScroll(info);onScroll && onScroll(info)}} + onScroll={this._onScroll} ref={this._bottomRightGridRef} rowCount={rowCount - fixedRowCount} rowHeight={this._rowHeightBottomGrid}