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

select2.full.js is not compatible with query option #3395

Closed
dbwhddn10 opened this issue May 21, 2015 · 3 comments
Closed

select2.full.js is not compatible with query option #3395

dbwhddn10 opened this issue May 21, 2015 · 3 comments

Comments

@dbwhddn10
Copy link
Contributor

http://plnkr.co/edit/o4A5mA

second element cannot select query data item

@kevin-brown
Copy link
Member

Here's a plunkr that uses your code but runs as-is: http://plnkr.co/edit/vGe5Rhq0aNjmhXmPkssB?p=preview

And removing your second query method (which was overriding the first) fixes your issue with no results: http://plnkr.co/edit/vGe5Rhq0aNjmhXmPkssB?p=preview

image


This appears to be more of a usage question than a bug report or common feature request. As we continue to keep the Select2 issue tracker geared towards these two areas, bug reports and common feature requests, we are redirecting usage questions to other communities such as the mailing list, IRC, or Stack Overflow.

@dbwhddn10
Copy link
Contributor Author

http://plnkr.co/edit/o4A5mA?p=preview
@kevin-brown
$('#select1') element's dataApater.current is operate.
$('#select2') element's initSelection is not operate

@kevin-brown
Copy link
Member

http://plnkr.co/edit/9e80kf3A4D6PUCJeFiGB?p=preview

The issue here appears to be that in your initSelection and current, you are checking to see if the value was set. But your <select> has no options, and none of them are selected, so there is no set value and .val() is returning undefined.

$('#select1') element's dataApater.current is operate.

If you put a log at the top you will notice that it is being triggered.


This appears to be more of a usage question than a bug report or common feature request. As we continue to keep the Select2 issue tracker geared towards these two areas, bug reports and common feature requests, we are redirecting usage questions to other communities such as the mailing list, IRC, or Stack Overflow.

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

2 participants