https://github.com/ignf/combobox
https://github.com/ignf/combobox
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ignf/combobox
- Owner: IGNF
- License: agpl-3.0
- Created: 2024-01-12T12:08:39.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-12T13:59:14.000Z (about 2 years ago)
- Last Synced: 2025-01-16T09:56:04.937Z (about 1 year ago)
- Size: 66.4 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# combobox
Elément combobox permettant la sélection d'un élément dans une liste déroulante et la recherche par autocompletion dans la liste
## Dépendances
Le module fonctionnant avec JQuery, la variable globale $ doit être définie dans le projet
jquery-ui (widget et autocomplete)
## Exemple d'utilisation
html:
mon premier choix\
mon second choix\
mon troisieme choix\
script:
$('select.combobox').each(function(){
let options = {
appendTo: "#my-content",
defaultValue: 3
};
$(this).combobox(options);
});
# on peut désactiver l'élément:
$('select.combobox').first().combobox("setDisabled", true);
# les évènements sont préfixés du nom du widget ([jquery ui widget](https://api.jqueryui.com/jquery.widget/)), ex:
$('select.combobox').first().on('comboboxselect', function(event, item) {
alert(`${item.item.value} est une super sélection, bravo!`);
});