-
Notifications
You must be signed in to change notification settings - Fork 34
classes_lib_controls_form_select.class
Represents a select element.
Extends: Control » Renderable
Subclasses: CurrencyFormatSelect, CurrencySelect, DateTimeFormatSelect, LanguageSelect, RegionSelect, Select2, TimezoneSelect
Creates an optgroup element.
Definition: public function AddGroup($label, $disabled=false)
Returns: static
Parameters:
-
string $label
The label text -
bool $disabled
True if disabled
Creates an option element.
Definition: public function AddOption($value, $label, $selected=false, $opt_group=false)
Returns: static
Parameters:
-
mixed $value
The value -
mixed $label
An optional label -
bool $selected
True if selected (hint: use Select::SetCurrentValue instead of evaluating selected state for each option) -
Control $opt_group
If given the option will be added to this optgroup element. Create one via Select::CreateGroup.
DEPRECATED (2022/07) Use Make and method-chaining instead Created and return a Select control.
Creates an optgroup element and returns it.
Same as Select::AddGroup, but return the OptGroup Control instead to $this
.
Definition: public function CreateGroup($label, $disabled=false)
Returns: Control OptGroup element
Parameters:
-
string $label
The label text -
bool $disabled
True if disabled
Creates a label element for this select. Note that this only ensures that the label is correctly assigned to this select. It will not add it somewhere!
Definition: public function CreateLabel($text)
Returns: Label The created label element
Parameters:
-
string $text
Text for the label
Creates an option and returns it.
Definition: public function CreateOption($value, $label, $selected=false, $opt_group=false)
Returns: Control The created option
Parameters:
-
mixed $value
The value -
mixed $label
An optional label -
bool $selected
True if selected (hint: use Select::SetCurrentValue instead of evaluating selected state for each option) -
Control $opt_group
If given the option will be added to this optgroup element. Create one via Select::CreateGroup.
Enables form auto-submission on value change.
This is done by submitting $(this).closest('form')
Definition: public function setAutoSubmit($on=true)
Returns: static
Parameters:
-
bool $on
if true, activates, else stops
DEPRECATED (2021/03) Use Select::setValue instead
Sets the name attribute.
Definition: public function setName($name)
Returns: static
Parameters:
-
string $name
The type
Sets the value attribute.
Definition: public function setValue($value)
Returns: static
Parameters:
-
string $value
The value
Set the option(s) as selected after the options have been added
Definition: private function _setval($children, $val)
Returns: NOT DOCUMENTED
Parameters:
-
$children
NOT DOCUMENTED -
$val
NOT DOCUMENTED
Definition: public function __construct($name=false)
Returns: NOT DOCUMENTED
Parameters:
-
string $name
The name