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.


(string, required) The action hook to call.
(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.


The filtered value.


// 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 );


No notes

Was this article helpful?

Related Articles