Hi, i am trying to use typeahead with multiple datasources but my results show up from only one data set. below is my typeahead code
$('#multiSearch').typeahead({
name: 'consumer name',
source: function (request, response) {
$.get("/Search/api/SearchByName/?name=" + request + '&isAutoComplete=' + true,
function (LookUpNames) {
return response(LookUpNames);
})
},
templates: {
header: '
'
}
}
);
It only fetches data from 1st data source but not the second one. Also i am unable to see the header name displaying when suggested results come up. What am i missing?
Hi, i am trying to use typeahead with multiple datasources but my results show up from only one data set. below is my typeahead code
$('#multiSearch').typeahead({
name: 'consumer name', source: function (request, response) { $.get("/Search/api/SearchByName/?name=" + request + '&isAutoComplete=' + true, function (LookUpNames) { return response(LookUpNames); }) }, templates: { header: '
NBA Teams
' } }, { name: 'nhl', displayKey: 'team', source: ['Unites States', 'Mexico', 'Canada', 'Cuba', 'Guatemala'], templates: { header: 'NHL Teams
' } } ); It only fetches data from 1st data source but not the second one. Also i am unable to see the header name displaying when suggested results come up. What am i missing?