MODULES Uize.Widget.mEventBindings
1. Introduction
The Uize.Widget.mEventBindings
mixin implements features to provide a declarative approach to wiring Uize events on widgets and their children, as well as DOM events on DOM nodes.
DEVELOPERS: Ben Ilegbodu, original code contributed by Zazzle Inc.
1.1. Examples
There are no dedicated showcase example pages for the Uize.Widget.mEventBindings
module.
SEARCH FOR EXAMPLES
Use the link below to search for example pages on the UIZE Web site that reference the Uize.Widget.mEventBindings
module...
SEARCH
1.2. Implementation Info
The Uize.Widget.mEventBindings
module defines the Uize.Widget.mEventBindings
object under the Uize.Widget
namespace.
1.2.1. Features Introduced in This Module
The features listed in this section have been introduced in this module.
STATIC PROPERTIES
Uize.Widget.mEventBindings.moduleName
| Uize.Widget.mEventBindings.pathToResources
1.2.2. Features Overridden in This Module
No features have been overridden in this module.
1.2.3. Features Inherited From Other Modules
This module has no inherited features.
1.2.4. Modules Directly Under This Namespace
There are no modules directly under this namespace.
1.2.5. Unit Tests
There is no dedicated unit tests module for the Uize.Widget.mEventBindings
module.
2. Static Methods
2.1. Uize.Widget.mEventBindings.eventBindings
Lets you conveniently wire events on the widget instance, its children and its DOM nodes.
SYNTAX
MyWidgetClass.eventBindings (bindingsOBJ);
VERBOSE EXAMPLE
MyNamespace.MyWidgetClass = Uize.Widget.mEventBindings.subclass ({ eventBindings:{ '#menu':{ // DOM node click:function (event, sourceNode) { }, mouseover:{ handler:function(_event, sourceNode) { }, fireIf:'busyInherited' } }, 'sliderG':{ // child widget 'Changed.value':function (event, sourceWidget) { }, Update:function(_event, sourceWidget) { } }, '':{ // self 'Changed.value':function (event) { }, Update:{ handler:function(_event) { }, required:'sliderG' } } } });
SHORT-HAND EXAMPLE
MyNamespace.MyWidgetClass = Uize.Widget.mEventBindings.subclass ({ eventBindings:{ '#menu:click':function(event, sourceNode) { }, '#menu:mouseover':{ handler:function(event, sourceNode) { }, fireIf:'busyInherited' }, 'sliderG:Changed.value':function (_event, sourceWidget) { }, 'sliderG:Update':function(event, sourceWidget) { }, ':Changed.value':function (event) { }, ':Update':{ handler:function(event) { }, required:['sliderG'] } } });
NOTES
You cannot use Uize.Widget.mEventBindings.eventBindings to wire events that have colons (: ) in their names |