onUpdateExecuteCallBackFunction
Use this function when you want to apply certain logic (or display a certain message) when a row is updated/edited. Use of this function is similar in a way to a java interface: you must define a function with the name specified in the function call.
The defined function must take ONE parameter (an array). The indexes of this array are the fields values of the entire edited row.
NOTE: this function will TURN OFF ajax editing (for that particular field)
Details
Requires | (callback function) |
---|---|
Type | function |
Returns | void |
Parameters
- fieldName
- name of the field which, after edited, will cause the callback function to be executed
- functionName
- name of the local, user-defined function to be invoked when the field is updated/edited
Example
$demo->onUpdateExecuteCallBackFunction("fldBirthday", "doMyLogicAfterUpdating"); //down below the showTable() function function doMyLogicForUpdating($array){ $pkBirthdayID = $array['pkBirthdayID']; //example index - field in db $fldName = $array['fldName']; //example index - field in db $fldBirthday = $array['fldBirthday']; //example index - field in db $age = calulateAge($fldBirthday, $fldName) //example function-not shown //update this table (or some other table) if ($fldURL == ''){ $success = qr("UPDATE tblPerson SET fldAge = \"$age\" WHERE pkPersonID = 3"); } }