Which function opens a window with buttons?
linkToButtons — you can specify multiple buttons with different codes.
=: linkToButtons(title: "Red or Blue"; buttons: $buttons; width: 400; html: "YOU ARE NEO")
buttons: listCreate(item: $btn1; item: $btn2)
btn1: rowCreate(field: "text" = "Red"; field: "code" = $code1; field: "icon" = "link"; field: "background" = "seashell"; field: "color"="red"; field: "vars" = $vars1; field: "refresh" = false)
vars1: rowCreate(field: "var1" = "You chose the red pill")
```code1:totum
=: linkToDataText(title: "III"; text: $#var1)
```
btn2: rowCreate(field: "text" = "Blue"; field: "code" = "name_field_in_table"; field: "icon" = "link"; field: "background" = "eliceblue"; field: "vars" = $vars2; field: "refresh" = true)
vars2: rowCreate(field: "var1" = "You chose the blue pill")
// text and code are mandatory parameters in row, others are not.
// Result: An active panel with two buttons, clicking on each of which opens a panel with text.
What are the ways to pass code to it for further execution?
The linkToButtons has a buttons
parameter that takes a list of buttons. Each line in this list describes a button.
Each line must have a row
where the button parameters are specified:
=: rowCreate(field: "text" = "Red"; field: "code" = "field_code"; field: "icon" = "link"; field: "background" = "seashell"; field: "color"="red"; field: "vars" = #vars; field: "refresh" = false)
There are two mandatory parameters — text
and code
, the rest are optional.
Is it possible to pass code with a standard reference to a line of code?
No — see the previous lesson about linkToInput
.
Do the codes get the environment parameters?
By default, the code receives some environment parameters:
$#ntn
— the name of the table from which input
is called
$#nh
— the hash of the current table (we will discuss this in advanced action codes)
#
— all grids of the current table.
Other variables can be passed through the vars
parameter.