Dropdown - sirinsidiator/ESO-LibAddonMenu GitHub Wiki
Data Table
property |
type |
default |
required |
description |
type |
string |
- |
yes |
The widget type of this control ("dropdown") |
name |
string |
- |
yes |
"My Dropdown", or string id or function returning a string |
choices |
table |
- |
yes |
{"table", "of", "choices"} |
choicesValues |
table |
- |
no |
{"foo", 2, "three"}, if specified, these values will get passed to setFunc instead |
getFunc |
function |
- |
yes |
The value provider for the dropdown. |
setFunc |
function |
- |
yes |
The assignment function for the dropdown. |
tooltip |
table |
- |
no |
"Dropdown's tooltip text.", or string id or function returning a string |
choicesTooltips |
table |
- |
no |
{"tooltip 1", "tooltip 2", "tooltip 3"}, or array of string ids or array of functions returning a string |
sort |
string |
- |
no |
"name-up", "name-down", "numeric-up", "numeric-down", "value-up", "value-down", "numericvalue-up", "numericvalue-down". If not provided, list will not be sorted. |
width |
string |
"full" |
no |
"full" or "half" width in the dropdown |
scrollable |
boolean, number |
- |
no |
if set the dropdown will feature a scroll bar if there are a large amount of choices and limit the visible lines to the specified number or 10 if true is used |
disabled |
boolean, function |
false |
no |
Determines if the dropdown is disabled and its value cannot be changed |
warning |
number, string, function |
nil |
no |
Shows a warning icon beside the dropdown which has a tooltip with some warning text |
requiresReload |
boolean |
false |
no |
Appends a special warning text and shows a reload button if the value is changed |
default |
number, function |
nil |
no |
Default value of the dropdown which is used to reset the panel to its defaults |
helpUrl |
string, function |
- |
no |
A string URL "https://www.esoui.com", or a function that returns one |
reference |
string |
nil |
no |
A unique global reference to the control |
Examples
{
type = "dropdown",
name = "My Dropdown",
tooltip = "Dropdown's tooltip text.",
choices = {"table", "of", "choices"},
getFunc = function() return "of" end,
setFunc = function(var) print(var) end,
width = "half", --or "half" (optional)
warning = "Will need to reload the UI.", --(optional)
},