Skip to content

Commit db634db

Browse files
committed
fix #1751
1 parent 9d73217 commit db634db

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/BootstrapTable.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,8 @@ class BootstrapTable extends Component {
880880
invalid();
881881
}
882882
};
883-
const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB);
883+
const props = { rowIndex, colIndex };
884+
const isValid = beforeSaveCell(this.state.data[rowIndex], fieldName, newVal, beforeSaveCellCB, props);
884885
if (isValid === false && typeof isValid !== 'undefined') {
885886
return invalid();
886887
} else if (isValid === Const.AWAIT_BEFORE_CELL_EDIT) {
@@ -896,13 +897,14 @@ class BootstrapTable extends Component {
896897
const { afterSaveCell } = this.props.cellEdit;
897898
const columns = this.getColumnsDescription(this.props);
898899
const fieldName = columns[colIndex].name;
900+
const props = { rowIndex, colIndex };
899901
if (onCellEdit) {
900902
newVal = onCellEdit(this.state.data[rowIndex], fieldName, newVal);
901903
}
902904

903905
if (this.allowRemote(Const.REMOTE_CELL_EDIT)) {
904906
if (afterSaveCell) {
905-
afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
907+
afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props);
906908
}
907909
return;
908910
}
@@ -916,7 +918,7 @@ class BootstrapTable extends Component {
916918
});
917919

918920
if (afterSaveCell) {
919-
afterSaveCell(this.state.data[rowIndex], fieldName, newVal);
921+
afterSaveCell(this.state.data[rowIndex], fieldName, newVal, props);
920922
}
921923
}
922924

0 commit comments

Comments
 (0)