JavaScript

{grid.object}runAction Method

Syntax

{grid.object}.runAction(actionName [, ele]);

Arguments

actionNamestring

The action to run.

eleobject

A pointer to a DOM element. This is only required if the action performs a task that is relative to other controls in the component, such as opening a window in a dropdown or positioned relative to another object.

Description

Runs a Javascript Action for the Grid Component that was defined using the Action Script builder.

Discussion

Runs an action that was defined using the Action javascript builder. You can optionally pass in a pointer to the object that invokes the action.

Passing in a pointer to the element that invokes the action is necessary when the action you are running opens a 'dropdown' window or a window positioned relative to an object.

Running an Action

To run an action, simply call {grid.object}.runAction with the name of the action to execute.

{grid.object}.runAction('report1');

Passing in a Pointer to an Element

Some actions, such as opening a window in a dropdown or a window that is positioned relative to another control, require additional information provided by passing an element to the {grid.object}.runAction method. You can pass the this pointer to the method to accomplish the task:

{grid.object}.runAction('showWindow',this);

You can also pass in a different element in your component. For example, suppose you wanted the popup window to appear relative to a button when the action is invoked:

//Get a pointer to BUTTON1 in Row 2
var ele = $('{grid.componentName}.V.R2.BUTTON1');

{grid.object}.runAction('showWindow', ele);

See Also