Skip to content

Commit

Permalink
fix #1751
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Nov 20, 2017
1 parent 9d73217 commit db634db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
Expand All @@ -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);
}
}

Expand Down

0 comments on commit db634db

Please sign in to comment.