fluid.createDomBinder(container, selectors) Section |
---|
Column |
---|
| Creates a new DOM Binder instance, used to locate elements in the DOM by name. Code Block |
---|
| javascript |
---|
| javascript |
---|
bgColor | white |
---|
borderStyle | nonejavascript |
---|
|
fluid.createDomBinder(container, selectors);
|
File name: Fluid.js Parameters Span |
---|
| container
| (Object) The root element in which to locate named elements. | selectors
| (Object) A collection of named jQuery selectors |
|
Return Value Span |
---|
| Object | representing the [fluid:DOM Binder and containing all of its functions (i.e. locate , fastLocate , clear , and refresh ) |
|
|
| NotesBy default, any component created using one of the framework component initialization functions (fluid.initView , fluid.initLittleComponent , fluid.initRendererComponent , fluid.initSubcomponent ) will have a DOM Binder automatically. If you use one of these functions, you no not need to call fluid.createDomBinder() . The DOM Binder will be attached to your that object as that.dom and its {{locate}} function will be accessible through that.locate() . Example Code Block |
---|
|
var selectors = {
addButton = ".add-button",
deleteButton = ".delete-button",
closeButton = ".close-button"
};
var domBinder = fluid.createDomBinder(containerEl, selectors);
|
In this example, domBinder will be a DOM Binder object, and will have locate , fastLocate , clear , and refresh functions. |