Corex. Dataset
(Corex v0.2.0)
View Source
Encode multi-value datasets for Corex component data-* attributes.
Prefer encode_json/1 when passing lists or maps into the DOM (select,
combobox, listbox, tags, tree-view, color picker presets, and similar).
Summary
Functions
Maps a boolean to "true" / "false" for dataset attributes.
JSON-encodes value for a dataset attribute, or nil when the value is nil
(attribute omitted).
Maps a boolean to its string, and anything else to nil so the attribute is
omitted. For dataset fields whose value reaches the library unvalidated.
Puts to_string(value) under key when value is not nil.
Functions
Maps a boolean to "true" / "false" for dataset attributes.
JSON-encodes value for a dataset attribute, or nil when the value is nil
(attribute omitted).
Maps a boolean to its string, and anything else to nil so the attribute is
omitted. For dataset fields whose value reaches the library unvalidated.
Puts to_string(value) under key when value is not nil.