ajaxCRUD.com

» a PHP class to create / read / update / delete from a database table using AJAX

   by loud canvas media

AjaxCRUD API Reference

<< Reference overview
<< Home

onAddExecuteCallBackFunction

calls a local function when a new row is added
void onAddExecuteCallBackFunction ( String functionName )

use this function when you want to apply certain logic (or display a certain message) when a new row is added. Use of this function is similiar in a way to a java interface: you must define a function with the name specifed in the function call.

This function must take ONE parameter (an array). The indexes of this array are the fields of the table. (with one extra index: "id")

Details

Requires (callback function)
Type function
Returns void

Parameters

functionName
name of the local function to be invoked when a file is uploaded

Example

$demo->onAddExecuteCallBackFunction("doMyLogicForAdding");

//down below the showTable() function
function doMyLogicForAdding($array){
  $pkMenuID = $array[pkMenuID];//these indexes are the fields of the db
  $fldName = $array[fldName];//these indexes are the fields of the db
  $fldURL = $array[fldURL]; //these indexes are the fields of the db

  //update this table (or some other table)
  if ($fldURL == ''){
    $success = qr("UPDATE tblMenu SET fldURL = \"$filename\"
                              WHERE pkMenuID = $pkMenuID");
  }
}

See also

New, Edit

 

"Sweet!!! One of the few packages that runs right out of the box. Just modify a couple of lines[s] [and] it runs perfectly."
~Mike