Any specification to use "beforeEditCell" or "afterEditCell" inside "cellEditProp"?

1

Having this code:

var cellEditProp = {
  mode: "click",
  blurToSave: true,
  afterSaveCell: function (row, cellName, cellValue) {
   /************************************/ 
  },

  beforeEditCell: function (rowid, cellname, value, irow, icol) {
    /***********************************/
  },

  afterEditCell: function (row, cellname, value){
    /***********************************/
  }
}

<BootstrapTable data={this.state.datos} cellEdit={cellEditProp}>

Why does the afterSaveCell function do it perfectly, but the other two do not? Any suggestions?

    
asked by XXx 18.11.2016 в 10:29
source

1 answer

0

Assuming what you're using is react-bootstrap-table , checking your documentation shows that cellEdit has the following properties:

  

mode : String (click / dbclick) (REQUIRED)

     

To determine which condition will trigger cell editing. (click or dbclick)

     

blurToSave : Bool

     

Enable blurToSave will trigger a saving event on cell when mouse blur on the input field. Default is false.

     

In the default condition, you need to press ENTER to save the cell.

     

beforeSaveCell : Function

     

Accept a custom callback function, before cell saving, this function will be called.

     

This callback function taking three arguments: row , cellName and cellValue

     

It's necessary to return to bool value which if apply this cell editing.

     

afterSaveCell : Function

     

Accept a custom callback function, after cell saving, this function will be called.

     

This callback function taking three arguments: row , cellName and cellValue

I do not know if you are relying on an example of an old version of the library or you would think that the functions of another attribute work for cellEdit , but you only worked afterSaveCell because it is indeed the only function that this attribute accepts . Both beforeEditCell and afterEditCell are not valid functions accepted by cellEdit .

    
answered by 19.11.2016 / 01:26
source