pub struct RowField {
pub meta: Meta,
pub key: String,
pub kind: FieldKind,
pub choices: Vec<RowChoice>,
pub choices_key: Option<String>,
pub command: String,
pub args: Value,
}Expand description
An editable cell: a record’s value shown as a field (a toggle, a
text, a choice) and written through a command whose arguments name
the record (${row.<key>}) and the new value (${value}). In a
table it takes the place of the column of its key, or adds one; in a
list it shows under the record’s title. Its when and enabled
read the record as row.<key>; its description is its tooltip.
Fields§
§meta: Meta§key: StringThe record’s key it shows.
kind: FieldKindtoggle, text or choice; another kind shows as text.
choices: Vec<RowChoice>§choices_key: Option<String>The choices from the record: an array of {value, label} at this
key (destinations that depend on the record).
command: String§args: ValueImplementations§
Source§impl RowField
impl RowField
Sourcepub fn toggle(key: &str, title: &str, command: &str, args: Json) -> RowField
pub fn toggle(key: &str, title: &str, command: &str, args: Json) -> RowField
A switch over a boolean.
Sourcepub fn text(key: &str, title: &str, command: &str, args: Json) -> RowField
pub fn text(key: &str, title: &str, command: &str, args: Json) -> RowField
A text, written when the field is left or Enter is pressed.
Sourcepub fn choice(
key: &str,
title: &str,
choices: &[(Json, &str)],
command: &str,
args: Json,
) -> RowField
pub fn choice( key: &str, title: &str, choices: &[(Json, &str)], command: &str, args: Json, ) -> RowField
One of the choices (value, label).
Sourcepub fn choices_from(self, key: &str) -> RowField
pub fn choices_from(self, key: &str) -> RowField
The choices read from the record at key.
Sourcepub fn choices_of(&self, row: &Json) -> Vec<RowChoice>
pub fn choices_of(&self, row: &Json) -> Vec<RowChoice>
The choices offered for a record: the declared ones, then those the record holds.
Sourcepub fn write_args(&self, values: &Values, value: Json) -> Json
pub fn write_args(&self, values: &Values, value: Json) -> Json
The command’s arguments for a new value: the template filled with
the values (the record’s as row.<key>) and value.