Dynamic Interactions: Empowering Your Components
For event management of components, we use Dynamics. The dynamics make the scheda's behavior adaptable to objects and options passed in the function call (FUN) or to user selections. We can enable interaction between subsections or between components, for example, by assigning values to variables or triggering a FUN.
To add a dynamic behavior to a component, we need to use ::G.DIN
.
Where and When
Where
and When
are two crucial parameters for Dynamics:
- Where allows us to identify which subsection we want to condition by specifying either the
Tit
or theId
. - When defines the action that triggers the dynamic behavior (e.g., on click, on changeRow, etc.).
::G.SEZ Pos(1)
::G.SUB.BTN Tit="*NONE"
::G.DIN When="Click" Where="Target"
::D.OGG D(Click me!)
::G.SEZ Pos(2)
::G.SUB.LAB Tit="*NONE" Id="Target"
::D.OGG D()
Exec
Exec
can be used instead of Where when we want to execute a FUN rather than establishing a relationship between two subsections.
::G.SEZ Pos(1)
::G.SUB.BTN Tit="*NONE"
::G.DIN When="Click" Exec="<FUN>"
::D.OGG D(Click me!)
Deferred Component Loading
Sometimes, it is necessary to load data as a result of a dynamic behavior so that it impacts a component. To achieve this, you can render the target component after the dynamic behavior has been executed by using the Load
property.
The Load
property accepts two parameters:
D
for deferred loadingI
for immediate loading
::G.SUB.LAB Tit="Destination" Load="D"
Conditional Dynamics
Conditional dynamics allow you to activate dynamic behaviors based on specific conditions. This enables the system to respond and adapt actions when predefined criteria are met, enhancing the interactivity and responsiveness of components.
- Condition based on specific variable:
::G.DIN Where="<target-id>" When="Click" Enabled="{'[VAR]' EQ '<value-to-compare>'}"
- Condition based on specific column:
::G.DIN Where="<target-id>" When="Click" Enabled="{'[<column-name>]' EQ '<value-to-compare>'}"
For comparison operators, refer to the following:
Operator | Alias | Description |
---|---|---|
EQ | = | Equals |
NE | <> | Not equals |
GT | > | Greater Than |
GE | >= | Greater or equals |
LT | < | Less Than |
LE | <= | Less or equals |
SC | Contains | |
NS | Not contains | |
BG | Begin with | |
ED | End with | |
LS | In list | |
LN | Out of list |