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

No option to set selected item programmatically #6

Closed
laurence73 opened this issue Jun 21, 2018 · 3 comments
Closed

No option to set selected item programmatically #6

laurence73 opened this issue Jun 21, 2018 · 3 comments

Comments

@laurence73
Copy link

Is there any way to programmatically set the selected item?

@pankajBsharp
Copy link

I am also looking for this feature please let me know if you fixed this or you fixed this with some other plugin.

@laurence73
Copy link
Author

I am using select2 now.

@dingyi1993
Copy link
Owner

I am also looking for this feature please let me know if you fixed this or you fixed this with some other plugin.

Sorry for so long to reply, I've add this feature in v1.0.4, you can use like:

$('#basic').trigger('set', { id: '3' });

or multi:

$('#multi').trigger('set', { id: '3,4' });

with override:

$('#multi').trigger('set', { id: '3,4', override: true });

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