<1> function: modify one column and then automatically modify another column.
Directly use the afteredit event. After a cell is edited, The afteredit event is triggered. You can use this event processing function to edit the cell information.
[Javascript]
Var gridPanel = new Ext. grid. EditorGridPanel ({
Id: "id ",
Store: myStore,
Height: 350,
ClicksToEdit: 1,
Cm: columnModel,
Sm: selectionModel,
ViewConfig :{
ForceFit: true,
EnableRowBody: false,
ShowPreview: false
},
Listeners :{
Afteredit: function (val ){
// The Order in the store corresponding to the column number
Ext. ux. Toast. msg ("prompt message", "column number:" + val. column + "row number:" + val. row );
Ext. ux. toast. msg ("prompt message", "field name:" + val. field + "Original Value:" + val. originalValue + "Current Value:" + val. value );
// Use the set method to modify the value and the get method to obtain the value.
// The following function is quantityLeft auto minus 1
Val. record. set ("quantityLeft", val. record. get ("quantityLeft")-(val. value-val. originalValue ));
}
}
});
Var gridPanel = new Ext. grid. EditorGridPanel ({
Id: "id ",
Store: myStore,
Height: 350,
ClicksToEdit: 1,
Cm: columnModel,
Sm: selectionModel,
ViewConfig :{
ForceFit: true,
EnableRowBody: false,
ShowPreview: false
},
Listeners :{
Afteredit: function (val ){
// The Order in the store corresponding to the column number
Ext. ux. Toast. msg ("prompt message", "column number:" + val. column + "row number:" + val. row );
Ext. ux. toast. msg ("prompt message", "field name:" + val. field + "Original Value:" + val. originalValue + "Current Value:" + val. value );
// Use the set method to modify the value and the get method to obtain the value.
// The following function is quantityLeft auto minus 1
Val. record. set ("quantityLeft", val. record. get ("quantityLeft")-(val. value-val. originalValue ));
}
}
});
: