Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
classapi-page

fluid.createDomBinder(container, selectors)

Section
Column
width70%

Creates a new DOM Binder instance, used to locate elements in the DOM by name.

Code Block
javascript
javascript
bgColorwhite
borderStylenonejavascript
fluid.createDomBinder(container, selectors);

File name: Fluid.js

Parameters

Span
classborderless-table

container

(Object) The root element in which to locate named elements.

selectors

(Object) A collection of named jQuery selectors

Return Value

Span
classborderless-table

Object

representing the [fluid:DOM Binder and containing all of its functions (i.e. locate, fastLocate, clear, and refresh)

Column
width5%

Column

See Also


Notes

By 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
javascript
javascript
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.