events.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <section>
  2. <div id="events" class="page-header">
  3. <h1>Events</h1>
  4. </div>
  5. <p>
  6. Select2 has an internal event system that is used to notify parts of the
  7. component that state has changed, as well as an adapter that allows some
  8. of these events to be relayed to the outside word.
  9. </p>
  10. <dl class="dl-horizontal">
  11. <dt>Adapter</dt>
  12. <dd>
  13. <code title="select2/selection">SelectionAdapter</code>
  14. </dd>
  15. <dt>Decorator</dt>
  16. <dd>
  17. <code title="select2/selection/eventRelay">EventRelay</code>
  18. </dd>
  19. </dl>
  20. <h2 id="events-public">
  21. Public events
  22. </h2>
  23. <p>
  24. All public events are relayed using the jQuery event system, and they are
  25. triggered on the <code>&lt;select&gt;</code> element that Select2 is
  26. attached to. You can attach to them using the
  27. <a href="https://api.jquery.com/on/"><code>.on</code> method</a> provided
  28. by jQuery.
  29. </p>
  30. <h2 id="events-internal">
  31. Internal events
  32. </h2>
  33. <p>
  34. Select2 triggers internal events using its own internal event system,
  35. which allows adapters to communicate with each other. These events are not
  36. accessible through the jQuery event system.
  37. </p>
  38. <p>
  39. You can find more information on the public events triggered by individual
  40. adapters in <a href="#adapters">the individual adapter documentation</a>.
  41. </p>
  42. </section>