Skip to content

Commit 198d191

Browse files
AllenFangpowellandy
authored andcommitted
fix #1751
1 parent 4a403d5 commit 198d191

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/BootstrapTable.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ class BootstrapTable extends Component {
881881
invalid();
882882
}
883883
};
884-
const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB);
884+
const props = { rowIndex, colIndex };
885+
const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB, props);
885886
if (isValid === false && typeof isValid !== 'undefined') {
886887
return invalid();
887888
} else if (isValid === Const.AWAIT_BEFORE_CELL_EDIT) {
@@ -897,13 +898,14 @@ class BootstrapTable extends Component {
897898
const { afterSaveCell } = this.props.cellEdit;
898899
const columns = this.getColumnsDescription(this.props);
899900
const fieldName = columns[colIndex].name;
901+
const props = { rowIndex, colIndex };
900902
if (onCellEdit) {
901903
newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal);
902904
}
903905

904906
if (this.allowRemote(Const.REMOTE_CELL_EDIT)) {
905907
if (afterSaveCell) {
906-
afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
908+
afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props);
907909
}
908910
return;
909911
}
@@ -917,7 +919,7 @@ class BootstrapTable extends Component {
917919
});
918920

919921
if (afterSaveCell) {
920-
afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
922+
afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props);
921923
}
922924
}
923925

0 commit comments

Comments
 (0)