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

autocomplete and two way binding #49

Open
pathsny opened this issue Mar 23, 2015 · 1 comment
Open

autocomplete and two way binding #49

pathsny opened this issue Mar 23, 2015 · 1 comment

Comments

@pathsny
Copy link

pathsny commented Mar 23, 2015

Is there a way to setup two way binding with autocomplete. As it is autocomplete uses objects with label and value properties. What would be ideal is if the autocomplete widget could get proper two way binding with an observable, and the value of the widget was always set to the label.

@mryellow
Copy link

Doable for simple lists of values without related ids.

http://stackoverflow.com/a/17060235/2438830

This may suit my use-case as I'm using denormalised data and another copy of the name is no big deal.

Related keys aren't dumped in the HTML attributes so can't lookup the related menu item and trigger menuselect as you need the related dropdown element.

The source function itself is interesting, takes a term and triggers a callback with the matching object, however we need the reverse of that. The filter function only checks value and label.

Not seeing anything on the jQuery end which could be used to hook in, it's all tied to the dropdown elements themselves. Could be extended to do so, but not sure how their release schedule works...

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