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

A field for handling a multi select with predefined options.

This field can not be searchable.

Field-specific options

See Backpex.Field for general field options.

  • :options - Required. List of options or function that receives the assigns.

  • :prompt - The text to be displayed when no option is selected or function that receives the assigns.

  • :not_found_text (String.t/0) - The text to be displayed when no options are found.

    The default value is "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
    },
  ]

Summary

Functions

validate_config!(field, live_resource)