2021.1

Table Of Contents
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
page874). 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 page1345).
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.
In addition, Dynamic Tables and their rows and cells have some special data- attributes that
can be used as selector. See: "A Dynamic Table's data- attributes" on page829.
Note however, that the data-repeat attribute cannot be used as a selector for template scripts,
since it gets removed when the table is expanded, which happens before template scripts run.
Page 901