MODULES Uize.Widget.mWebBindings
1. Introduction
The Uize.Widget.mWebBindings
module is an aggregator mixin module that allows widget classes to more easily mix in Uize.Widget.mWeb
and other widget binding modules with additional helpful functionality.
DEVELOPERS: Ben Ilegbodu
1.1. Examples
There are no dedicated showcase example pages for the Uize.Widget.mWebBindings
module.
SEARCH FOR EXAMPLES
Use the link below to search for example pages on the UIZE Web site that reference the Uize.Widget.mWebBindings
module...
SEARCH
1.2. Implementation Info
The Uize.Widget.mWebBindings
module defines the Uize.Widget.mWebBindings
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.mWebBindings.moduleName
| Uize.Widget.mWebBindings.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.mWebBindings
module.
2. Instance Methods
2.1. webSelect
Selects descendent DOM nodes within the root node matching the specified selector, returning a Uize.Web
object that wraps the node(s).
The selector is modified such that class selectors are appropriately prefixed with their cssClassPrefix
and ID selectors are appropriately prefixed with their idPrefix
.
SYNTAX
webOBJ = widgetOBJ.webSelect(selectorSTR);
EXAMPLE MARKUP
<ul id="page_mylist" class="MyList"> <li id="page_myList-item0" class="MyList-item">Item 0</item> <li id="page_myList-item1" class="MyList-item">Item 1</item> <li id="page_myList-item2" class="MyList-item">Item 2</item> <li id="page_myList-item3" class="MyList-item">Item 3</item> <li id="page_myList-item4" class="MyList-item MyList-selected">Item 4</item> <li id="page_myList-item5" class="MyList-item">Item 5</item> </ul>
EXAMPLE CODE
var items = myList.webSelect('.item');
The code above returns a Uize.Web
object with the 6 list item DOM nodes. The specified selector is transformed from ".item"
to ".MyList-item"
using the cssClass
method (from Uize.Widget.mBindings
) and then searches within the root node for matching DOM nodes.
EXAMPLE CODE 2
var thirdItem = myList.webSelect('#item2');
The code above returns a Uize.Web
object with the DOM node that has an ID of "page_myList-item2"
. The specified selector is transformed from "#item2"
to "#page_myList-item2"
using the idPrefix
method (from Uize.Widget
) and then searches within the root node for matching DOM nodes.
An ID selector is equivalent to myList.web('item2')
.
EXAMPLE CODE 3
var selectedItem = myList.webSelect('li.selected');
The code above returns a Uize.Web
object with the DOM node that has an ID of "page_myList-item4"
because it is an <li> tag with a class of ".MyList-seelcted"
.
NOTES
See related cssClass instance method of Uize.Widget.mBindings |
|
See related idPrefix instance method of =Uize.Widget. |
|
See also Uize.Web object |