Skip to content

Using typeahead with "remote" option doesn't filter out drop down results #248

Closed
@swapnilmishra

Description

@swapnilmishra

Below is the code to init typeahead

var moviesTypeahead = $('#moviesTypeahead').typeahead({
    name: 'movies',
    remote:'movies.json',
    template: template,
    engine: Handlebars
});

this is my movies.json datasource

[
    {
        "adult": false,
        "backdrop_path": "mBLimfLfAcAhKTSf6d2lU8fNNuJ.jpg",
        "id": 13387,
        "name": "@Transporter3",
        "value": "Transporter 3",
        "release_date": "2008-12-05",
        "poster_path": "/eEQ4JieKyLBRRSRnRGuPlxp7qiS.jpg",
        "popularity": 2.4774809734915,
        "title": "Transporter 3",
        "vote_average": 7.6,
        "vote_count": 20
    },
    {
        "adult": false,
        "backdrop_path": null,
        "id": 94261,
        "name": "@TheAmazingTransplant",
        "value": "The Amazing Transplant",
        "release_date": "1970-01-01",
        "poster_path": "/xJ8mOfMyvg6aVLRSpdSO1sL3Lcj.jpg",
        "popularity": 0.2,
        "title": "The Amazing Transplant",
        "vote_average": 0,
        "vote_count": 0
    }
]

Now suppose i start typing out "ama" it doesn't filter out the other result item namely "@TRANSPORTER3". But if i change datasource type to prefetch instead of remote filtering works. Just wondering why its not filtering out results in case of remote.

Below are screenshots for same.

Prefetch

screen shot 2013-05-19 at 1 15 30 pm

Remote

screen shot 2013-05-19 at 1 19 03 pm

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