MediaWiki:Sidebar: Różnice pomiędzy wersjami
Nie podano opisu zmian |
Nie podano opisu zmian Znacznik: Wycofane |
||
| Linia 19: | Linia 19: | ||
* SEARCH | * SEARCH | ||
* LANGUAGES | * LANGUAGES | ||
// Example: Create a DropdownWidget and use the getMenu() method to get the | |||
// contained menu and modify it. | |||
var dropDown = new OO.ui.DropdownWidget( { | |||
label: 'Dropdown menu: Select one option', | |||
menu: { | |||
items: [ | |||
new OO.ui.MenuOptionWidget( { | |||
data: 'a', | |||
label: 'First' | |||
} ), | |||
new OO.ui.MenuOptionWidget( { | |||
data: 'b', | |||
label: 'Second' | |||
} ), | |||
new OO.ui.MenuOptionWidget( { | |||
data: 'c', | |||
label: 'Third' | |||
} ) | |||
] | |||
} | |||
} ); | |||
$( document.body ).append( dropDown.$element ); | |||
// Get the menu from the dropdown using the getMenu() method. | |||
// In this example, the getItemFromData() method returns a reference to the option | |||
// that contains the specified data (i.e., 'a', which is the first menu option). | |||
// This option is then disabled with the setDisabled() method. | |||
dropDown.getMenu().getItemFromData( 'a' ).setDisabled( true ); | |||
Wersja z 06:46, 16 mar 2024
- navigation
- mainpage|mainpage-description
- Ekwipunek|Ekwipunek
- Modyfikacje_Sprzętu|Modyfikacje Sprzętu
- Drify|Drify
- Orby|Orby
- Przeciwnicy|Przeciwnicy
- Przedmioty|Przedmioty
- Respawn|Respawn
- Power|Power
- Zwierzaki|Zwierzaki
-
- Zgłoś_błąd|! ZGŁOŚ BŁĄD !
- DISCORD
- TOOLBOX
- SEARCH
- LANGUAGES
// Example: Create a DropdownWidget and use the getMenu() method to get the // contained menu and modify it. var dropDown = new OO.ui.DropdownWidget( { label: 'Dropdown menu: Select one option', menu: { items: [ new OO.ui.MenuOptionWidget( { data: 'a', label: 'First' } ), new OO.ui.MenuOptionWidget( { data: 'b', label: 'Second' } ), new OO.ui.MenuOptionWidget( { data: 'c', label: 'Third' } ) ] } } );
$( document.body ).append( dropDown.$element );
// Get the menu from the dropdown using the getMenu() method. // In this example, the getItemFromData() method returns a reference to the option // that contains the specified data (i.e., 'a', which is the first menu option). // This option is then disabled with the setDisabled() method. dropDown.getMenu().getItemFromData( 'a' ).setDisabled( true );