View Source ExTeal.Fields.MultiSelect (ExTeal v0.27.0)

The MultiSelect field may be used to generate a drop-down menu with multiple fields.

The select menu's options may be defined using the MultiSelect/with_options/2 function:

MultiSelect.make(:regions)
|> MultiSelect.with_options([%{value: 1, label: "USA"}, %{value: 2, label: "EU"}])

You can also return a list of maps with value, title, subtitle and thumbnail keys to use 'card' style taggables, useful when the multiselect represents a relationship.

Summary

Types

@type card_option() :: %{
  :value => :integer | String.t(),
  :title => String.t(),
  optional(:subtitle) => String.t(),
  optional(:thumbnail) => String.t()
}
@type simple_option() :: %{value: :integer | String.t(), label: String.t()}
@type valid_option() :: simple_option() | card_option()
@type valid_options() :: [valid_option()]

Functions