Chico UI

ch.Extend (Class)

Documentation updated on Fri May 18 2012 12:47:09 GMT-0300 (GMT-03:00), generated by JsDoc Toolkit 2.4.0

Overview

Extend is a utility that resolve creating interfaces problem for all UI-Objects.

Summary

Classdetail

Parameters

  • name: string. Interface's name.
  • klass: function. Class to inherit from.
  • process: function, Optional. Optional function to pre-process configuration, recieves a 'conf' param and must return the configration object.

Returns

  • class

Examples

// Create an URL interface type based on String component.
ch.extend("string").as("url");
// Create an Accordion interface type based on Menu component.
ch.extend("menu").as("accordion");
// And the coolest one...
// Create an Transition interface type based on his Modal component, with some conf manipulations:
ch.extend("modal").as("transition", function(conf) {
	conf.closeButton = false;
	conf.msg = conf.msg || conf.content || "Please wait...";
	conf.content = $("<div>").addClass("loading").after( $("<p>").html(conf.msg) );
	return conf;
});