Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Data Grid

  • Last UpdatedJun 25, 2024
  • 3 minute read

Use scripts to set and get values for the properties of the Data Grid control.

Basic

Property

Scripting Supported

Example

Name

Yes

Writable

Readable

To set the property

control.findById("ID").tagName = "Value for Name";

To get the value of the property

control.findById("ID").tagName;

XML Node

Yes

Readable

To get the value of the property

control.findById("ID").xmlNodeBoundTo;

Description

Yes

Writable

Readable

To set the property

control.findById("ID").description = "Value for Description";

To get the value of the property

control.findById("ID").description;

Tooltip

No

Not Applicable

Configuration Name

No

Not Applicable

Appearance

Property

Scripting Supported

Script

Visible

Yes

Writable

Readable

To set the property

control.findById("ID").visible = true;

To get the value of the property

control.findById("ID").visible;

Read-Only

Yes

Writable

Readable

To set the property

control.findById("ID").readOnly = true;

To get the value of the property

control.findById("ID").readOnly;

Label Position

No

Not Applicable

Label-Control Area

No

Not Applicable

Width

No

Not Applicable

Height

No

Not Applicable

Rearrange Columns

No

Not Applicable

Resize Columns

No

Not Applicable

Retain Space

No

Not Applicable

Multiple Selection

No

Not Applicable

Show Export Button

No

Not Applicable

Export Type

No

Not Applicable

Export All Pages

No

Not Applicable

Adapt UI

No

Not Applicable

Custom Style Sheet Identifier

No

Not Applicable

Validation

Property

Scripting Supported

Example

Mandatory

Yes

Writable

Readable

To set the property

control.findById("ID").isMandatory = true;

To get the value of the property

control.findById("ID").isMandatory;

Advanced

Property

Scripting Supported

Example

On Data Bound

Yes

For more information, see scripting guidelines for On Data Bound property.

On Data Change

Yes

For more information, see scripting guidelines for On Data Change property.

On Selection Change

Yes

For more information, see scripting guidelines for On Selection Change property.

ID

No

Not Applicable

Behavior

No

Not Applicable

Page Size

No

Not Applicable

Extended Information

No

Not Applicable

Select First Record

No

Not Applicable

Auto-select Record

No

Not Applicable

Summary Columns

No

Not Applicable

Auto-load Grid

Yes

Writable

Readable

To set the property

control.findById("ID").autoLoadGrid = skelta.grid.autoLoadGrid.OnFormLoadAndParameterChange;

control.findById("ID").autoLoadGrid = skelta.grid.autoLoadGrid.OnFormLoad;

control.findById("ID").autoLoadGrid = skelta.grid.autoLoadGrid.Never;

To get the value of the property

control.findById("ID").autoLoadGrid;

Include in Summary

No

Not Applicable

Use Culture Specific Values

No

Not Applicable

Scripts

Property

Scripting Supported

Example

Name

Yes

return "Value for Name";

Description

Yes

return "Value for Description";

Visible

Yes

return true;

For more information, see scripting guidelines for Visible property.

Read-Only

Yes

return false;

For more information, see scripting guidelines for Read-Only property.

Mandatory

Yes

return true;

For more information, see scripting guidelines for Mandatory property.

Value

Yes

return "%3CGrid%3E%3CData%3E%3CCountryLP%3E%3CCountryId%3E%3C!%5BCDATA%5B10%5D%5D%3E%3C%2FCountryId%3E%3CCountryName%3E%3C!%5BCDATA%5BIN%5D%5D%3E%3C%2FCountryName%3E%3C%2FCountryLP%3E%3C%2FData%3E%3C%2FGrid%3E";

Note:
- The value represents the records whose check box is selected. To clear check box of all records, set the value to an empty string.
- The return value must be URL encoded.
- For example,
"<Grid><Data><CountryLP><CountryId><![CDATA[10]]></CountryId><CountryName><![CDATA[IN]]></CountryName></CountryLP></Data></Grid>"

where CountryLP is the Lookup name, CountryId and CountryName are columns persisted in the grid configuration is URL encoded as

"%3CGrid%3E%3CData%3E%3CCountryLP%3E%3CCountryId%3E%3C!%5BCDATA%5B10%5D%5D%3E%3C%2FCountryId%3E%3CCountryName%3E%3C!%5BCDATA%5BIN%5D%5D%3E%3C%2FCountryName%3E%3C%2FCountryLP%3E%3C%2FData%3E%3C%2FGrid%3E"

Validate

Yes

return new ValidationOptions(false, "Error Message");

OR

return new ValidationOptions(true, "");

For more information, see scripting guidelines for Validate property.

Improving Performance of Parameterized Data Grid

The behavior of parameterized data grids on data change of parameters with Refresh On Parameter Change property is as follows.

Form Mode

Property Value

Control Behavior

New Mode

(Fill Form, Preview Form)

Yes

Data grid is refreshed when a parameter is changed.

No

Data grid is not refreshed when a parameter is changed.

To refresh the data grid when the last parameter is changed, code the script for the On Data Change event of the last parameter as follows:

control.findById("G1").refreshOnParamChange = true;

Edit Mode

(Inbox)

Yes

Data grid is refreshed when a parameter is changed.

No

Data grid is not refreshed when a parameter is changed.

To refresh the data grid when a parameter is changed, code the script for the On Data Change event of that parameter as follows:

var editMode = SFU.isFormInEditMode();

if(editMode)

{

control.findById("G1").refreshOnParamChange = true;

}

For more information, see Show Icons in Data Grid Columns.

Note:
- Display value is readable.
- You can retrieve the display value via script as follows:

return control.findById("ID").displayValue;

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in