inputEx - ColorPickerField Usage

This field is a wrapper around the YUI ColorPicker widget.

Basic ColorPickerField creation

Use the following code to create a basic inputEx ColorPickerField.

Click to view the available colors
1new inputEx.ColorPickerField({parentEl: 'container1', label: 'Choose a color', description: 'Click to view the available colors' }); 
view plain | print | ?

Smaller ColorPickerField

Use the following code to create a ColorPickerField without controls

Log :
1var field = new inputEx.ColorPickerField({parentEl: 'container2', label: 'Choose a color', value:'#2626AF', colorPickerOptions:{showcontrols:false} }); 
2 
3// Register the 'updatedEvt' and log the value to the page 
4var logDiv = inputEx.cn('div'nullnull"Log :"); 
5YAHOO.util.Dom.get('container2').appendChild(logDiv); 
6field.updatedEvt.subscribe(function(e,params) { 
7    var val = params[0]; 
8    logDiv.appendChild( inputEx.cn('div'nullnull"Updated at "+(new Date())+" with value: "+val) ); 
9}); 
view plain | print | ?