Index

mmo-select

1 symbol · generated 5 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>
Extends
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
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
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

Attributes11

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

Properties12

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:197

Get the enum of the select

get enum() set enum(value)
Type
array

multiple

accessormmo-select.jhs:255

Get the multiple of the select

get multiple() set multiple(value)
Type
boolean

validationMessage

accessormmo-select.jhs:282

Get the validation message of the select

get validationMessage() set validationMessage(value)
Type
string

validity

readonlyaccessormmo-select.jhs:298

Get the validity of the select

get validity()
Type
object

willValidate

readonlyaccessormmo-select.jhs:319

Check if the select will validate

get willValidate()
Type
boolean

value

accessormmo-select.jhs:366

Get the value of the select

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

Methods28

hasInput()

mmo-select.jhs:239

Check if the select has an input

hasInput()
returnsbooleantrue if the select has an input

isDropdown()

mmo-select.jhs:247

Check if the select is a dropdown

isDropdown()
returnsbooleantrue if the select is a dropdown

isMultiple()

mmo-select.jhs:274

Check if the select is multiple

isMultiple()
returnsbooleantrue if the select is multiple

checkValidity()

mmo-select.jhs:327

Check the validity of the select

checkValidity()
returnsbooleantrue if the select is valid

isSameValue(value, search, multiple)

mmo-select.jhs:342

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
returnsbooleantrue

setValueByIndex(group, index)

mmo-select.jhs:420

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:466

Set the value of the select by node

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

addGroup(id, label)

mmo-select.jhs:490

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()
returns

addOption(value, label, group)

mmo-select.jhs:522

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
returnsthe node created
select.addOption(entity, entity.title)

removeOption(value)

mmo-select.jhs:561

Remove an option from the select

removeOption(value)
value

removeGroup(group)

mmo-select.jhs:579

Remove a group from the select

removeGroup(group)
groupstring- The group of the select

setOptions(options, group)

mmo-select.jhs:592

Set options for a specific group

setOptions(options, group = null)
optionsArray[[value, label]], addOption
group = nullstring

getOptions(group)

mmo-select.jhs:611

Get the options of a specific group from the select

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

select(index)

mmo-select.jhs:691

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

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

show(event)

mmo-select.jhs:794

Show select close to its input

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

isShown()

mmo-select.jhs:846

Check if the select is shown

isShown()
returnsbooleantrue if the select is shown

eventClick(event)

mmo-select.jhs:877

On click event

eventClick(event)
eventEvent- The event
returnsvoid

eventInput(event)

mmo-select.jhs:901

On input event

eventInput(event)
eventEvent- The event
returnsvoid

eventKey(event)

mmo-select.jhs:910

On key event

eventKey(event)
eventEvent- The event
returnsvoid

CSS hooks7

.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