2021.2

Table Of Contents
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 page838.
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.
The data-script attribute is used if you let the Designer create a script for you (see "Quick-start
a script with the Create script button" on the previous page).
How the scope of a script can simplify code
It is recommended to set the scope of a script that targets (an element in) dynamically added
rows to Each matched element.
The selector of a script that targets (something in) a row that is linked to a detail table will
probably match multiple elements.
By setting the scope of a script you can determine whether you want to run the script once, or
once for each element that matches the selector. (See "Setting the scope of a script" on
page883.)
Page 911