Skip to content

Commit

Permalink
add description for #1245
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed May 6, 2017
1 parent f620b19 commit 178ed3e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/js/cell-edit/cell-edit-hook-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ function onBeforeSaveCell(row, cellName, cellValue) {
return true;
}

function onBeforeSaveCellAsync(row, cellName, cellValue, done) {
// if your validation is async, for example: you want to pop a confirm dialog for user to confim
// in this case, react-bootstrap-table pass a callback function to you
// you are supposed to call this callback function with a bool value to perfom if it is valid or not
// in addition, you should return 1 to tell react-bootstrap-table this is a async operation.

// I use setTimeout to perform an async operation.
// setTimeout(() => {
// done(true); // it's ok to save :)
// done(false); // it's not ok to save :(
// }, 3000);
// return 1; // please return 1
}

const cellEditProp = {
mode: 'click',
blurToSave: true,
Expand Down

0 comments on commit 178ed3e

Please sign in to comment.