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

data-source parameter #154

Open
leizard opened this issue Aug 18, 2016 · 1 comment
Open

data-source parameter #154

leizard opened this issue Aug 18, 2016 · 1 comment

Comments

@leizard
Copy link

leizard commented Aug 18, 2016

Hi, thank you for awesome package.
How could I use parameter in the data-source helper function. Some thing like this:

    <input class="form-control typeahead" name="team" type="text"
     placeholder="NBA teams"
     autocomplete="off" spellcheck="off"
     data-source="(customerCodes code)"
     data-select="selected"
     data-render="rendered"/>

and the helper:

Template.myTemplate.helpers({
    customerCodes: function(code) {
         return Customers.find({code: code}).fetch().map(function(it){ return {id: it._id, value: it.code};    });
    }
})

Thank you.

@sergeyt
Copy link
Owner

sergeyt commented Sep 2, 2016

Hi @leizard, I think you could just return all customer codes and typeahead input does the rest, since it is autocomplete input :)

janat08 pushed a commit to janat08/meteor-typeahead that referenced this issue Apr 12, 2018
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