Extending w2ui

Since v.2 w2ui provide an easy way to extend functionality of any widget or create custom ones. All widgets are written as classes that extend w2base class.
This base class only has the event flow functionality:
  • on(event, handler) - method to add an event
  • off(event, [handler]) - method to remove an event
  • trigger(edata) - method to trigger an event
  • handlers, - an array of all event handlers defined for the class
That you can use it to add event listeners and trigger events.
See events for additional information.
Below is an example how to create your own custom control.

User Comments

comments powered by Disqus