Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I dynamically change the selected values? #35

Open
TheAkiraxD opened this issue Sep 27, 2018 · 2 comments
Open

How can I dynamically change the selected values? #35

TheAkiraxD opened this issue Sep 27, 2018 · 2 comments

Comments

@TheAkiraxD
Copy link

TheAkiraxD commented Sep 27, 2018

Can anybody tell me how could I dynamically change the selected values for this plugin using jQuery? Thanks

@TheAkiraxD TheAkiraxD changed the title How to dinamically change the selected values How can I dinamically change the selected values? Sep 27, 2018
@TheAkiraxD TheAkiraxD changed the title How can I dinamically change the selected values? How can I dynamically change the selected values? Sep 27, 2018
@shirishwebonise
Copy link

You need to use .choose function on the dropdown object.
Please refer to the documentation.

@sam48910
Copy link

sam48910 commented Jan 5, 2022

The example in that part of the documentation is apparently wrong. Here's how:

// create dropdown
var myDropdown = $('selector').dropdown({a:option,b:option}).data();
// change value
myDropdown.choose('some value in the options list');  // if single choice
myDropdown.choose(['value a','value c','value z']); // if multiple choice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants