SproutCMS

This is the code documentation for the SproutCMS project

function setPostAddJavaScriptFunc()

Set the name of a javascript function to call after each multiedit item is added

The JavaScript function is called with the following arguments:
    $div     jQuery element for the outer div
    data     Array of field data OR null for a new record
    idx      The record index

Usage

void MultiEdit::setPostAddJavaScriptFunc ( string $function_name );

Example

// You can use bare functions
MultiEdit::setPostAddJavaScriptFunc('alert')

Example

// Or object functions (this is good for testing)
MultiEdit::setPostAddJavaScriptFunc('console.log')

Example

// If you're insane, you can put a whole blob of JS in there
MultiEdit::setPostAddJavaScriptFunc('(function($div,data,idx){  console.log($div);  })')

Arguments

  1. string $function_name

Return value

  • void