Namespace views.components
Small components/widgets, such as drop down menus to switch between seasons/teams.
Defined in: <js/views/components.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
views.components.dropdown(formId, fields, selected, updateEvent, extraParam)
Creates or updates a dropdown form.
|
Method Detail
<static>
views.components.dropdown(formId, fields, selected, updateEvent, extraParam)
Creates or updates a dropdown form.
- Parameters:
- {string} formId
- DOM ID of the form element to fill.
-
{Array.
} fields - Array of strings of the type of fields to allow (current acceptable values are "teams" and "seasons"). Each element represents a dropdown and a component of the URL - so if "teams" and "seasons" is passed, URLs will be generated like /l/1/.../ATL/2014.
- {Array} selected
- Array of values corresponding to the default "selected" value of each field, like "CHI" or 2022 for "teams" or "seasons".
- {string} updateEvent
- Update event describing what has changed in this reload.
- {?string=} extraParam
- Any extra parameter to append to the URL, like /l/1/.../ATL/2014/extraParam. Default is to append nothing.