Class Behavior

Provides a base class for all ASP.NET AJAX client behaviors.

see

{@link http://msdn.microsoft.com/en-us/library/bb311020(v=vs.100).aspx}

Hierarchy

Index

Constructor methods

Methods

Constructor methods

constructor(): Component

When overridden in a derived class, initializes an instance of that class and registers it with the application as a disposable object.

Returns

Component

Methods

public add_disposing(handler: Function)

Raised when the dispose method is called for a component.

Parameters

  • handler: Function

public add_propertyChanged(handler: Function)

Raised when the raisePropertyChanged method of the current Component object is called.

Parameters

  • handler: Function

public beginUpdate()

Called by the create method to indicate that the process of setting properties of a component instance has begun.

public dispose()

Removes the current Behavior object from the application. The dispose method releases all resources from the Sys.UI.Behavior object, unbinds it from its associated HTML Document Object Model (DOM) element, and unregisters it from the application.

public endUpdate()

Called by the create method to indicate that the process of setting properties of a component instance has finished. This method is called by the create method ($create). Sets the isUpdating property of the current Component object to false, calls the initialize method if it has not already been called, and then calls the updated method.

public static getBehaviorByName(element: DomElement, name: string): Behavior

Gets a Sys.UI.Behavior instance with the specified name property from the specified HTML Document Object Model (DOM) element. This member a static member and can be invoked without creating an instance of the class.

Parameters

Returns

Behavior

The specified Behavior object, if found; otherwise, null.

public static getBehaviors(element: DomElement): Behavior[]

Gets the Sys.UI.Behavior objects that are associated with the specified HTML Document Object Model (DOM) element. This member is static and can be invoked without creating an instance of the class.

Parameters

  • element: DomElement
          The Sys.UI.DomElement object to search.
    

Returns

Behavior[]

An array of references to Behavior objects, or null if no references exist.

public static getBehaviorsByType(element: DomElement, type: Behavior): Behavior[]

Gets an array of Sys.UI.Behavior objects that are of the specified type from the specified HTML Document Object Model (DOM) element. This method is static and can be invoked without creating an instance of the class.

Parameters

Returns

Behavior[]

An array of all Behavior objects of the specified type that are associated with the specified DOM element, if found; otherwise, an empty array.

public get_element(): DomElement

Gets the HTML Document Object Model (DOM) element that the current Sys.UI.Behavior object is associated with.

Returns

DomElement

The DOM element that the current Behavior object is associated with.

public get_events(): any

Gets an EventHandlerList object that contains references to all the event handlers that are mapped to the current component's events. This member supports the client-script infrastructure and is not intended to be used directly from your code.

Returns

any

 An EventHandlerList object that contains references to all the events and handlers for this component.

public get_id(): string

Gets or sets the identifier for the Sys.UI.Behavior object. A generated identifier that consists of the ID of the associated Sys.UI.DomElement, the "$" character, and the name value of the Behavior object.

Returns

string

public get_isInitialized(): boolean

Gets a value indicating whether the current Component object is initialized.

Returns

boolean

 true if the current Component is initialized; otherwise, false.

public get_isUpdating(): boolean

Gets a value indicating whether the current Component object is updating.

Returns

boolean

 true if the current Component object is updating; otherwise, false.

public get_name(): string

Gets or sets the name of the Sys.UI.Behavior object.

Returns

string

public initialize()

Initializes the current Component object. The initialize method sets the isInitialized property of the current Component object to true. This function is called by the create method ($create) and overridden in derived classes to initialize the component.

public raisePropertyChanged(propertyName: string)

Raises the propertyChanged event for the specified property.

Parameters

  • propertyName: string
              The name of the property that changed.
    

public remove_disposing(handler: Function)

Raised when the dispose method is called for a component.

Parameters

  • handler: Function

public remove_propertyChanged(handler: Function)

Raised when the raisePropertyChanged method of the current Component object is called.

Parameters

  • handler: Function

public set_id(value: string)

Gets or sets the identifier for the Sys.UI.Behavior object.

Parameters

  • value: string
          The string value to use as the identifier.
    

public set_name(value: string)

Parameters

  • value: string

public updated()

Called by the endUpdate method as a placeholder for additional logic in derived classes. Override the updated method in a derived class to add custom post-update logic.