inputEx Documentation Back to homepage

inputEx Documentation > Field development 0.2.2

How to create your own fields

Once you've grasped the main ideas behind inputEx, you'll probably want to create your own fields. Here are some hints on how to do so :

Choose the right parent Class

Look at the classes to pick the "closest" one. (in terms of code)
If you want to start from scratch, you should inherit from inputEx.Field

use YAHOO.extend to extend classes

Override methods

Some methods have a precise role :

  • setOptions : declare the options and their default value
  • render : create a wrapper around the field DOM and insert the component
  • renderComponent : render the DOM for your field
  • initEvents : subscribe to events once rendered
  • getValue : get the value of your field
  • setValue : set the value of your field

Send the updated event

Fire this event to indicate modifications (with this.fireUpdatedEvt())

Register your type

After your class definition, you can associate your class to a type string. You can either create a new type, or override a previous one.

use inputEx.registerType("myType", inputEx.MyFieldClass);


Copyright (c) 2007-2009 Eric Abouaf. All rights reserved.
Generated by JsDoc Toolkit 2.0.0 on Wed, 04 Mar 2009 15:41:32 GMT using neyricjslibs-template.