ASP.NET 3.5 and above only
Obout.Ajax.UI Controls - Color Picker - Client side
Note |
To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. For example, to get or set a value for a property such as autoPostBack, you call the get_autoPostBack or set_autoPostBack methods:
|
var pickerObject = $find("<%= picker1.ClientID %>");
var _autoPostBack = pickerObject.get_autoPostBack();
...
pickerObject.set_autoPostBack(true); |
Properties
| Name |
Description |
autoClose
|
boolean. Gets or sets a value indicating whether to close the popup on click outside it.
Default true (close on click outside).
|
autoPostBack
|
boolean. Gets or sets a value indicating whether a postback to the server automatically occurs when color is picked.
Default false.
|
button
|
object. Gets or sets the DOM element to show the ColorPicker popup when clicked.
|
element
|
object. Gets the DOM element that the Behavior is associated with (target element).
(Inherited from Sys.UI.Behavior.)
|
horizontalPosition
|
HorizontalPositionType.
Gets or sets the horizontal position of the picker popup according to the target DOM element.
Default Obout.Ajax.UI.ColorPicker.HorizontalPositionType.Right.
|
id
|
string. Gets the generated identifier that consists of the ID of the associated Sys.UI.DomElement object
, the "$" character, and the name value of the Behavior object.
(Inherited from Sys.UI.Behavior.)
|
initialColor
|
string. Gets or sets initial color set in popup.
Default "#000000".
|
isPopup
|
boolean. Gets a value indicating whether the color picker ia a popup.
Default true.
|
offsetLeft
|
number. Gets or sets the additional left offset of the positioned picker popup in pixels.
Default 0.
|
offsetTop
|
number. Gets or sets the additional top offset of the positioned picker popup in pixels.
Default 0.
|
pickButton
|
boolean. Gets a value indicating whether the 'Pick' button is shown in the picker popup.
Default true show).
|
targetElement
|
object. Gets the DOM element that the extender is associated with on open.
|
targetProperty
|
string. Gets or sets the target element property to be changed on color picked.
Default "value".
|
verticalPosition
|
VerticalPositionType.
Gets or sets the vertical position of the picker popup according to the target DOM element.
Default Obout.Ajax.UI.ColorPicker.VerticalPositionType.Bottom.
|
uniqueID
|
string. Gets the unique, hierarchically qualified identifier for the server control.
|
zIndex
|
number. Gets or sets the z-index of positioned picker popup.
Default -1 (is not set).
|
Methods
| Name |
Description |
setColor(color)
|
Sets the current(selected) color in the picker.
It has one parameter: string color to set.
Example:
function onClientOpen(sender, args) {
sender.setColor(sender.get_targetElement().style.backgroundColor);
}
|
Note |
To add or remove handler functions for client API events, you must call methods that are named with the add_ and remove_ prefixes. For example, to add or remove a handler function for an event such as picked, you call the add_picked or remove_picked methods:
|
function pickedHandler(sender, args) {
alert("Picked color: " + args.get_color());
}
...
var pickerObject = $find("<%= picker1.ClientID %>");
pickerObject.add_picked(pickedHandler);
...
pickerObject.remove_picked(pickedHandler); |
Events
obout.com
Obout.Ajax.UI controls
TreeView - 43
HTML Editor - 274
File Upload - 19
Color Picker - 17
Spell Checker - 16
Poll - 26
Captcha - 15
File Manager - 8