Skip to content

Commit

Permalink
fix #1751
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang authored and powellandy committed Dec 6, 2017
1 parent 4a403d5 commit 198d191
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 @@ -881,7 +881,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 @@ -897,13 +898,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 @@ -917,7 +919,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 198d191

Please sign in to comment.