edit-text
Overview
edit-text
is the simplest type of editable cells. This cell type is used when the data captured requires standard utf-8
input. The data allows for line breaks and is treated as a textarea
, as opposed to a textfield
.
Basic Example
<object-table ...>
<column display="{field}">
<edit-text value="$object.field" on-change="$:valueChanged($object, newValue, oldValue)" />
</column>
</object-table>
Standard Attributes
on-change
on-change
Optional
Default: unset
A JavaScript/TypeScript $:function
that executes when a cell's value is updated (once the user hits enter).
<object-table ...>
<column heading="Editable field" display="{name}">
<edit-text on-change="$:valueChanged($object, newValue, oldValue)" />
</column>
</object-table>
function valueChanged(object, newValue, oldValue){
object.name = newValue;
object.save();
}
value
value
Required
Default: unset
The object field or result of a $:function
which is the initial editable value shown when the user edits the cell. Valid values are:
value="$object.[field]"
value="$:getInitialEditingValue($object)"
Unlike display
, value
is not a text attribute and must therefore represent a variable or result of a function, i.e. do not use string literals to give it a value in curly brackets like this: value="{do_not_do_this}"
Advanced Attributes
clear-button-visibility
clear-button-visibilityclear-button-visibility
disabled
disabled
Optional
Type: boolean
Default: false
When a particular editable cell should not be editable based on a condition, the disabled
attribute can be used to dynamically turn it into a standard display-only cell. This attribute has access to $object
.
Also see:
disabledLast updated