doc: property inheritance

This commit is contained in:
jean-emmanuel 2018-01-05 16:49:18 +01:00
parent 370c73c7aa
commit 17db9f5d77

View file

@ -6,12 +6,18 @@ Widgets can use each other's property values by using the following syntaxes:
- `@{parent.propertyName}`
- `@{widgetId.propertyName}` (where `widgetId` is the target widget's `id`)
`propertyName` can be any of the target widget's properties. Additionally, the special property name `_value` refers to a widget's value, as opposed to its `value` property.
It can be used to:
- concatenate strings: `/@{parent.id}/some_suffix`
- define object value: `["@{parent.id}"]`
If the retreived property is an object (`[] / {}`), it can be used as is or one can retreive a specfic item from it: `@{parent.variables.0}` will try to return the first item of the parent's `variables` property.
If the retreived property is an object (`[] / {}`), a subset can be defined by appending a dot and a key (array index or object key) : `@{parent.variables.key}`
!!! note ""
The root panel's `id` is `root`.
!!! warning "What about reverse inheritance ?"
Containers cannot inherit their children's properties but to define their `value` property.