ASP.NET 3.5 and above only

Obout.Ajax.UI Controls - Color Picker - Client side

Obout.Ajax.UI.ColorPicker.ColorPickerBehavior class

 Inheritance Hierarchy

It is a client-side representation of the server-side Obout.Ajax.UI.ColorPicker.ColorPickerExtender class.
Note 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
propertyautoClose boolean. Gets or sets a value indicating whether to close the popup on click outside it.
Default true (close on click outside).
propertyautoPostBack boolean. Gets or sets a value indicating whether a postback to the server automatically occurs when color is picked.
Default false.
propertybutton object. Gets or sets the DOM element to show the ColorPicker popup when clicked.
propertyelement object. Gets the DOM element that the Behavior is associated with (target element). (Inherited from Sys.UI.Behavior.)
propertyhorizontalPosition HorizontalPositionType. Gets or sets the horizontal position of the picker popup according to the target DOM element.
Default Obout.Ajax.UI.ColorPicker.HorizontalPositionType.Right.
propertyid 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.)
propertyinitialColor string. Gets or sets initial color set in popup.
Default "#000000".
propertyisPopup boolean. Gets a value indicating whether the color picker ia a popup.
Default true.
propertyoffsetLeft number. Gets or sets the additional left offset of the positioned picker popup in pixels.
Default 0.
propertyoffsetTop number. Gets or sets the additional top offset of the positioned picker popup in pixels.
Default 0.
propertypickButton boolean. Gets a value indicating whether the 'Pick' button is shown in the picker popup.
Default true show).
propertytargetElement object. Gets the DOM element that the extender is associated with on open.
propertytargetProperty string. Gets or sets the target element property to be changed on color picked.
Default "value".
propertyverticalPosition VerticalPositionType. Gets or sets the vertical position of the picker popup according to the target DOM element.
Default Obout.Ajax.UI.ColorPicker.VerticalPositionType.Bottom.
propertyuniqueID string. Gets the unique, hierarchically qualified identifier for the server control.
propertyzIndex number. Gets or sets the z-index of positioned picker popup.
Default -1 (is not set).

Methods

Name Description
propertysetColor(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 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

Name Description
propertycancel Raised when picker popup is canceled.
Event's argument has type Sys.CancelEventArgs.
propertyopen Raised when picker popup is opened.
Event's argument has type Sys.EventArgs.Empty.
propertypicked Raised when color is picked.
Event's argument has type Obout.Ajax.UI.ColorPicker.ColorPickedEventArgs.

"You guys have the best controls around."

Neal Miller
Miller Systems, Inc.

Random testimonial   All testimonials