Child pages
  • fluid.createDomBinder

Documentation for a historical release of Infusion: 1.4
Please view the Infusion Documentation site for the latest documentation, or the Infusion 1.3. Documentation for the previous release.
If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Skip to end of metadata
Go to start of metadata

fluid.createDomBinder(container, selectors)

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

fluid.createDomBinder(container, selectors);

File name: Fluid.js

Parameters

container (Object) The root element in which to locate named elements.
selectors (Object) A collection of named jQuery selectors

Return Value

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

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

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.

  • No labels