MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

mmo-select

1 symbole · générée le 27 Oct 2026

element

mmo-select

mmo-select.jhs:1

Select element to display a list of options

<mmo-select name icon readonly disabled value required url search multiple enum placeholder></mmo-select>
Étend
CustomAPIElement
You can put <option> and <optgroup> inside the mmo-select. They will be converted automatically. WARNING: using <option> only allow to put string value. Using setOptions permits using any type of value.

Index

namethe name of the icon
iconthe icon of the select
readonlyif true, the select is readonly
disabledif true, the select is disabled
valuethe current value of the mmo-select (NOTE: can be any type, object included).
requiredif true, the select is required
urlan url to a json api or a json stringify object: {collection, repository, filters}
searchthe current text being searched
multipleif true, the select is multiple
enumthe enum of the select
placeholderthe placeholder of the select
ViewDefault static readonly accessor
data accessorSet the data of the select
disabled accessorGet the disabled of the select
readonly accessorGet the readonly of the select
required accessorGet the required of the select
enum accessorGet the enum of the select
multiple accessorGet the multiple of the select
validationMessage accessorGet the validation message of the select
validity readonly accessorGet the validity of the select
willValidate readonly accessorCheck if the select will validate
value accessorGet the value of the select
search accessorGet the search of the select
constructor()
init()
focus()Focus the input element
hasInput()Check if the select has an input
isDropdown()Check if the select is a dropdown
isMultiple()Check if the select is multiple
checkValidity()Check the validity of the select: a required one holds a value, whatever its mode.
isSameValue(value, search, multiple)Check if search is contained or is the same value as value As entities cannot be compared, if the value is an entity, we check if their uid is the same
clear()Clear the value of the select
setValueByIndex(group, index)Set the value of the select by index
setValueByNode(node)Set the value of the select by node
addGroup(id, label)Add a group for options
addOption(value, label, group)Add option
removeOption(value)Remove an option from the select
removeGroup(group)Remove a group from the select
setOptions(options, group)Set options for a specific group: replaces the options it had, the other groups' are kept
getOptions(group)Get the options of a specific group from the select
clearOptions()Clear all options of the select
clearSearch()Clear the search of the select
select(index)Select an element (but don't set the value)
toggleSelectAll()Toggle the select all of the select
updatePosition()Update the position of the select
show(event)Show select close to its input
isShown()Check if the select is shown
hide()Hide hintbox
eventClick(event)On click event
eventInput(event)On input event
eventKey(event)On key event
.with-inputshow the input search
.dropdownshow the options like a dropdown
.anchor-topthe list opens upwards, for a control near the bottom of the screen
.roundedadd a border radius to the select
.searchingadd a border to the select
.floatingdisplays the select as a floating element
.compactreduce the gap between the options

Attributs11

value

mmo-select.jhs

the current value of the mmo-select (NOTE: can be any type, object included). It CAN be different of the value in the input.

value

url

mmo-select.jhs

an url to a json api or a json stringify object: {collection, repository, filters}

url

Propriétés12

disabled

accessormmo-select.jhs:146

Get the disabled of the select

get disabled() set disabled(value)
Type
boolean

readonly

accessormmo-select.jhs:163

Get the readonly of the select

get readonly() set readonly(value)
Type
boolean

required

accessormmo-select.jhs:180

Get the required of the select

get required() set required(value)
Type
boolean

enum

accessormmo-select.jhs:201

Get the enum of the select

get enum() set enum(value)
Type
array

multiple

accessormmo-select.jhs:259

Get the multiple of the select

get multiple() set multiple(value)
Type
boolean

validationMessage

accessormmo-select.jhs:286

Get the validation message of the select

get validationMessage() set validationMessage(value)
Type
string

validity

readonlyaccessormmo-select.jhs:302

Get the validity of the select

get validity()
Type
object

willValidate

readonlyaccessormmo-select.jhs:323

Check if the select will validate

get willValidate()
Type
boolean

value

accessormmo-select.jhs:373

Get the value of the select

get value() set value(value)
Type
array | *

Méthodes28

hasInput()

mmo-select.jhs:243

Check if the select has an input

hasInput()
retournebooleantrue if the select has an input

isDropdown()

mmo-select.jhs:251

Check if the select is a dropdown

isDropdown()
retournebooleantrue if the select is a dropdown

isMultiple()

mmo-select.jhs:278

Check if the select is multiple

isMultiple()
retournebooleantrue if the select is multiple

checkValidity()

mmo-select.jhs:334

Check the validity of the select: a required one holds a value, whatever its mode.

checkValidity()The value is the one chosen, or given before its options load (`userValue`), never the text of the search: an empty one (`with-input`, `dropdown`; a field saved as '') is no choice (my.oviepro #264). A select that is not `required` is valid empty, as a <select> is.
retournebooleantrue if the select is valid

isSameValue(value, search, multiple)

mmo-select.jhs:349

Check if search is contained or is the same value as value As entities cannot be compared, if the value is an entity, we check if their uid is the same

isSameValue(value, search, multiple = false)
valueArray | *the current select's value (a list if multiple)
search*the new value to look for
multiple = false
retournebooleantrue

setValueByIndex(group, index)

mmo-select.jhs:436

Set the value of the select by index

setValueByIndex(group, index)
groupstring- The group of the select
indexnumber- The index of the select

setValueByNode(node)

mmo-select.jhs:482

Set the value of the select by node

setValueByNode(node)
nodeElement- The node of the select
retournebooleantrue if the value is set by node

addGroup(id, label)

mmo-select.jhs:506

Add a group for options

addGroup(id, label = null)
idstring
label = null?(string | Node | MMO.core.dom.Html)the group's header, the id when there is none: text unless it is a node (MMO.core.dom.appendChildren), markup you wrote goes through MMO.core.dom.html()
retourne

addOption(value, label, group)

mmo-select.jhs:538

Add option

addOption(value, label = null, group = null)
value*any value to use as the value
label = null?(string | Node | NodeList | MMO.core.dom.Html)what the option shows, the value when there is none: text unless it is a node (MMO.core.dom.appendChildren) -- an entity's title from the api shows as it was typed. Markup you wrote goes through MMO.core.dom.html()
group = nullstring | Elementan id for a group
retournethe node created
select.addOption(entity, entity.title)

removeOption(value)

mmo-select.jhs:580

Remove an option from the select

removeOption(value)
value

removeGroup(group)

mmo-select.jhs:598

Remove a group from the select

removeGroup(group)
groupstring- The group of the select

setOptions(options, group)

mmo-select.jhs:612

Set options for a specific group: replaces the options it had, the other groups' are kept

setOptions(options, group = null)
optionsArray[[value, label]], addOption
group = null?stringnull for the options outside any group
select.setOptions([['fr', 'France'], ['be', 'Belgique']], 'Europe')

getOptions(group)

mmo-select.jhs:640

Get the options of a specific group from the select

getOptions(group)
groupstring- The group of the select
retournearrayThe options of the select

select(index)

mmo-select.jhs:727

Select an element (but don't set the value)

select(index)
indexnumber | Element | nullif an element, will figure out the correct current index
retournevoid

show(event)

mmo-select.jhs:831

Show select close to its input

show(event = null)
event = nullEvent- The event
retournevoid

isShown()

mmo-select.jhs:883

Check if the select is shown

isShown()
retournebooleantrue if the select is shown

eventClick(event)

mmo-select.jhs:914

On click event

eventClick(event)
eventEvent- The event
retournevoid

eventInput(event)

mmo-select.jhs:938

On input event

eventInput(event)
eventEvent- The event
retournevoid

eventKey(event)

mmo-select.jhs:949

On key event

eventKey(event)
eventEvent- The event
retournevoid

Points d'accroche CSS7

.anchor-top

mmo-select.jhs

the list opens upwards, for a control near the bottom of the screen

.anchor-top

.floating

mmo-select.jhs

displays the select as a floating element

.floating