MediaWiki:Sidebar: Różnice pomiędzy wersjami

Z Wiki BR
Przejdź do nawigacji Przejdź do wyszukiwania
Nie podano opisu zmian
Znacznik: Wycofane
Nie podano opisu zmian
Znacznik: Ręczne wycofanie zmian
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:47, 16 mar 2024