View Source PhoenixFormAwesomplete.HookComponent (PhoenixFormAwesomplete v1.0.2)

Provides function components for the Awesomplete component, for autocomplete functionality. Uses a hook for the javascript code. Usable inside and outside LiveView.

Summary

Functions

Provide functionality like PhoenixFormAwesomplete.awesomplete_script via client hook.

Provide functionality like PhoenixFormAwesomplete.copy_value_to_field via client hook.

Provide functionality like PhoenixFormAwesomplete.copy_value_to_id via client hook.

Transfer ownership of the DOM from LiveView to custom javascript code after the initial rendering. Another way to set phx-update="ignore" without scattering this phx attribute in the templates.

Functions

Provide functionality like PhoenixFormAwesomplete.awesomplete_script via client hook.

Attributes

  • id (:string)
  • forField (:any) (required) - Phoenix.HTML.FormField struct or field name.
  • forForm (:any) - Phoenix.HTML.Form struct or form name. Not needed when FormField is used.
  • nonce (:any) - In liveview the nonce will be ignored.
  • Global attributes are accepted. the options for awesomplete_script. Supports all globals plus: ["ajax", "assign", "autoFirst", "combobox", "container", "convertInput", "convertResponse", "data", "debounce", "descr", "descrSearch", "filter", "item", "label", "list", "listLabel", "loadall", "limit", "maxItems", "minChars", "multiple", "prepop", "replace", "sort", "statusNoResults", "statusTypeXChar", "statusXResults", "url", "urlEnd", "value"].
Link to this function

copy_value_to_field(assigns)

View Source

Provide functionality like PhoenixFormAwesomplete.copy_value_to_field via client hook.

Attributes

  • id (:string)
  • sourceField (:any) (required) - Phoenix.HTML.FormField struct.
  • targetField (:any) (required) - Phoenix.HTML.FormField struct.
  • nonce (:any) - In liveview the nonce will be ignored.
  • Global attributes are accepted. dataField: Optional, dataField to be copied, for example: capital. Supports all globals plus: ["dataField"].
Link to this function

copy_value_to_id(assigns)

View Source

Provide functionality like PhoenixFormAwesomplete.copy_value_to_id via client hook.

Attributes

  • id (:string)
  • field (:any) (required) - Phoenix.HTML.FormField struct or field name.
  • form (:any) - Phoenix.HTML.Form struct or form name. Not needed when FormField is used.
  • target (:any) (required) - target: css selector, for example: #capital.
  • nonce (:any) - In liveview the nonce will be ignored.
  • Global attributes are accepted. dataField: Optional, dataField to be copied, for example: capital. Supports all globals plus: ["dataField"].

Transfer ownership of the DOM from LiveView to custom javascript code after the initial rendering. Another way to set phx-update="ignore" without scattering this phx attribute in the templates.

Attributes

  • id (:string) (required)
  • Global attributes are accepted.

Slots

  • inner_block