Event – PHP Autocomplete https://phpautocomplete.com The Ultimate PHP Dropdown Tue, 11 Feb 2014 21:23:15 +0000 en-US hourly 1 https://wordpress.org/?v=7.0.4 add_event() https://phpautocomplete.com/docs/add_event/ Tue, 11 Feb 2014 18:57:32 +0000 http://phpautocomplete.com/?p=104 Add event handler. A typical use of this method is to pass Select2 event name, then a Javascript event handler function. Note that the generated Javascript methods is injected BEFORE end of $(document).ready(…)

Signature:

public function add_event(param1, param2, ....)

Parameter:

  • variable-length argument lists

A list of supported events:

  • change
  • select2-opening
  • select2-open
  • select2-close
  • select2-highlight
  • select2-selecting
  • select2-removing
  • select2-removed
  • select2-loaded
  • select2-focus
  • select2-blur
  • select2-clearing

Example:

$pac -> add_event('select2-close', 'function() { console.log("close"); }');
]]>