ch.Object (Class)

Documentation updated on Fri Jul 06 2012, generated by JsDoc Toolkit.

Overview

Object represents the abstract class of all Objects.

View source on GitHub

Returns

Properties

element

Reference to a DOM Element. This binding between the component and the HTMLElement, defines context where the component will be executed. Also is usual that this element triggers the component default behavior.

HTMLElement

type

This public property defines the component type. All instances are saved into a 'map', grouped by its type. You can reach for any or all of the components from a specific type with 'ch.instances'.

string

uid

The 'uid' is the Chico's unique instance identifier. Every instance has a different 'uid' property. You can see its value by reading the 'uid' property on any public instance.

number

Methods

off(event, handler)

Removes a callback function from specific event.

Parameters

  • event Since version 0.7.1: string Event nawidget.
  • handler Since version 0.7.1: function Handler function.

Returns

  • itself

Examples

Will remove event handler to the "ready" event

var startDoingStuff = function () {
    // Some code here!
};

widget.off("ready", startDoingStuff);
on(event, handler)

Add a callback function from specific event.

Parameters

  • event Since version 0.7.1: string Event nawidget.
  • handler Since version 0.7.1: function Handler function.

Returns

  • itself

Examples

Will add a event handler to the "ready" event

widget.on("ready", startDoingStuff);
once(event, handler)

Add a callback function from specific event that it will execute once.

Parameters

  • event Since version 0.8.0: string Event nawidget.
  • handler Since version 0.8.0: function Handler function.

Returns

  • itself

Examples

Will add a event handler to the "contentLoad" event once

widget.once("contentLoad", startDoingStuff);