Skip to content

Commit

Permalink
Adds documentation for data-label-* directive (#975)
Browse files Browse the repository at this point in the history
Adds documentation for data-label-* directive
  • Loading branch information
HazelGrant authored Jul 11, 2024
1 parent f942604 commit 9b0642d
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,30 @@ Here we have a checkbox ``enable_cuda_version`` that will show
data:
hide-cuda-version-when-unchecked: true
Dynamic Element Labels
**********************

The ``data-label-*`` directive allows you to change the label of another
form element based on the selected option in a select widget.

.. code-block:: yaml
attributes:
node_type:
widget: select
options:
- [ 'small', 'small', data-label-cores: 'Number of Cores (1-4)' ]
- [ 'medium', 'medium', data-label-cores: 'Number of Cores (1-8)' ]
- [ 'large', 'large', data-label-cores: 'Number of Cores (1-16)' ]
cores:
widget: "number_field"
required: true
value: 1
In this case, selecting Node Type 'small' will change the label of Cores to
'Number of Cores (1-4)'.

Dynamic Min and Maxes
*********************

Expand Down

0 comments on commit 9b0642d

Please sign in to comment.