2020.1

Table Of Contents
l A new script will be created and opened in the Script Editor.
The selector of the new script is the data-script attribute with the name of the data field that
the element was linked to as its value. For example: table [data-script='ID'].
The code of the script replaces the contents of the element with the current value of the data
field:
var field = this.record.fields['ID'];
if (field) {
this.text(formatter.upperCase(field));
}
The scope of the script is set to Each matched element (see "Setting the scope of a script" on
page383). This means that in the code, this refers to the element that matches the selector,
and this.record refers to the current (nested) detail record (see "this" on page834).
Tip
To get access to the row in which the cell is located, you can use this.parent().
Note
If you bind the element to a data field again (by selecting it and then selecting a field from the Field
drop-down on the Attributes pane), the data-script attribute will be removed.
Writing scripts for a Dynamic Table
If you're going to create your own scripts for Dynamic Tables, there are a few things you need to
know.
Selectors
Scripts that target (an element in) a Dynamic Table can use the same types of selectors as
other scripts. In the output, Dynamic Table rows are repeated including any classes that are set
on the row and on its contents.
Page 410