You can pass the returned data through the filter
function which then parses the data to your liking. So in your example above, you would do something like this:
$('#autocomplete').typeahead({
name: 'organizations',
prefetch:
{
url: 'jsoncall',
filter: function(data){
// filter the returned data
return [data.movies[0].title, data.movies[1].title, data.movies[2].title];
}
}
}
);
The example above would work if your returned data set was a JSON object that looked something like this:
movies: [{id:12865, title:Kill Bill: Volume 1, year:2003, mpaa_rating:R, runtime:111,…},…]
0: {id:12865, title:Kill Bill: Volume 1, year:2003, mpaa_rating:R, runtime:111,…}
1: {id:12862, title:Kill Bill, Volume 2, year:2004, mpaa_rating:R, runtime:137,…}
2: {id:771237417, title:Kill Bill: The Whole Bloody Affair, year:2011, mpaa_rating:Unrated, runtime:,…}
3: {id:770998578, title:Angel of Death: Killer Nurse: A Bill Kurtis Special Report, year:2006,…}
4: {id:771352617, title:Kedi Billa Killadi Ranga, year:2013, mpaa_rating:Unrated, runtime:145,…}
total: 5