Skip to content

Multiple Datasets with Bloodhound with different sources #97

Closed

Description

@panips

I have a question regarding multiple data sets. I want to setup two data sources in my typeahead with different headers. Hence i made two bloodhound objects, one with a local source and another with a remote source. The problem i am facing is that while the local source is searchable, the remote source shows no suggestions. I can see the remote call going through and returning with a dataset from the server but the typeahead doesn't show the result.
The example code is in a gist

Activity

  1. jlbooker commented on Nov 14, 2016

    @jlbooker
    Contributor

    @panips First, I'd suggest simplifying the problem by removing the local source. Try to get just the remote source working on its own first.

    Which version of the project are you using? This sounds possibly related to an outstanding bug in the upstream twitter project (see twitter/typeahead.js#1212). Please try cloning the latest version of this project, or use NPM to install it with npm install corejs-typeahead@beta, then try again with just the remote source.

  2. panips commented on Nov 15, 2016

    @panips
    Author

    Thanks a lot for helping me out and pointing me in the right direction :)... I was not sending the async function parameter in the search function i.e. instead of allNames.search(q, sync); , I should have used allNames.search(q, sync, async);
    The typeahead is now working perfectly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions