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

Typeahead should take datasets as an array (not just list) #664

Closed
vitalpoltava opened this issue Feb 7, 2014 · 1 comment
Closed

Typeahead should take datasets as an array (not just list) #664

vitalpoltava opened this issue Feb 7, 2014 · 1 comment

Comments

@vitalpoltava
Copy link

Hello,

Sometimes (when I use the typeahead.js in a widget) I do not know how many datasets will go to init phase and I need to provide those datasets as an array. I tried to use typeahead.apply(context, datasests), but seems it is not applicable, as can't provide context (please let me know if there is a way). So, it would be nice to have an ability to provide multiple datasets, wrapped in array list, as a second argument. To achieve this I'd offer to add something like the following to the initialize method:

var datasets = _.map([].slice.call(arguments, 1), function(el) {return el;});

It will serve both situations (when we provide datasets as an array and as a list of arguments).

Regards!

@jharding jharding added this to the v0.10.1 milestone Feb 7, 2014
@jharding
Copy link
Contributor

jharding commented Feb 7, 2014

Good thinking. This should be a pretty simple change, I'll aim to get it in the next release (v0.10.1).

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

No branches or pull requests

2 participants