DiviAreaItem.doAction()

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Functions
  6. DiviAreaItem.doAction()
DiviAreaItem.doAction(hook, ...params)

Runs a JS action via DiviArea.doAction() with the given hook name.

This function will call two hooks: One exactly as specified in the hook, and one with the Area-Key suffix. The actions are called in that order.

Params

hook
(string, required) The action hook to call.
...params
(mixed, optional) Additional parameters to send to the callback handler. If no params are specified, then a reference to this DiviAreaItem is sent to the callback.

Returns

The filtered value.

Examples

// Invoke an area action.
area.doAction( 'show_area' );

// The above function is identical to the following code:
DiviArea.doAction( 'show_area', area );
DiviArea.doAction( 'show_area' + area.theKey(), area );

Notes

No notes

Was this article helpful?

Related Articles