View Source Backpex.Fields.MultiSelect (Backpex v0.6.0)

A field for handling a multi select with predefined options.

This field can not be searchable.

Options

  • :options - Required (keyword) list of options to be used for the select.
  • :prompt - The text to be displayed when no options are selected or function that receives the assigns. Defaults to "Select options...".
  • :not_found_text - The text to be displayed when no options are found. Defaults to "No options found".

Example

@impl Backpex.LiveResource
def fields do
  [
    users: %{
      module: Backpex.Fields.MultiSelect,
      label: "Users",
      options: fn _assigns -> [{"Alex", "user_id_alex"}, {"Bob", "user_id_bob"}] end
    },
  ]