Prima.Listbox.JS (Prima v0.3.0)
View SourceJavaScript commands for client-side listbox control.
Summary
Functions
Sets the value of the listbox with the given ID.
Functions
Sets the value of the listbox with the given ID.
The value must match one of the listbox's options; otherwise nothing changes.
Dispatches no events unless notify: true is given.
Options
:notify- also dispatchinputandchangeon the hidden input, so a parent form'sphx-changefires (default:false)
Examples
<button type="button" phx-click={Prima.Listbox.JS.set_value("role-listbox", "viewer")}>
Reset role
</button>
<button
type="button"
phx-click={JS.push("reset") |> Prima.Listbox.JS.set_value("role-listbox", "viewer", notify: true)}
>
Reset role
</button>