From db634db0573995427b743cf3919b7b2f5824b1de Mon Sep 17 00:00:00 2001 From: AllenFang Date: Mon, 20 Nov 2017 20:31:57 +0800 Subject: [PATCH] fix #1751 --- src/BootstrapTable.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index a0275c19f..7f3327532 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -880,7 +880,8 @@ class BootstrapTable extends Component { invalid(); } }; - const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB); + const props = { rowIndex, colIndex }; + const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB, props); if (isValid === false && typeof isValid !== 'undefined') { return invalid(); } else if (isValid === Const.AWAIT_BEFORE_CELL_EDIT) { @@ -896,13 +897,14 @@ class BootstrapTable extends Component { const { afterSaveCell } = this.props.cellEdit; const columns = this.getColumnsDescription(this.props); const fieldName = columns[colIndex].name; + const props = { rowIndex, colIndex }; if (onCellEdit) { newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal); } if (this.allowRemote(Const.REMOTE_CELL_EDIT)) { if (afterSaveCell) { - afterSaveCell(this.state.data[rowIndex], fieldName, newVal); + afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props); } return; } @@ -916,7 +918,7 @@ class BootstrapTable extends Component { }); if (afterSaveCell) { - afterSaveCell(this.state.data[rowIndex], fieldName, newVal); + afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props); } }