I just migrated my backoffice from Boostrap 2 to Boostrap 3.
My typeahead instruction give me some problems.
On bootstrap v2 I had this :
var typeaheadSettings = {
source: function (query, process) {
list = [];
return $.ajax({
minLength: 3,
item: 10,
url: "/ajax/articles/",
type: 'POST',
data : { query: query },
dataType: 'json',
success: function (result) {
var resultList = result.aaData.map(function (item) {
list[item.name + ' - ' + item.code + ' (' + item.category + ')'] = item.id;
return item.name + ' - ' + item.code + ' (' + item.category + ')';
});
return process(resultList);
}
});
},
updater: function (item) {
$("#parent").val(list[item]);
$(this).attr("placeholder",item);
}
};
for now, with Bootstrap 3 and typeahead (v. 0.9.3) included explicitly, I am on this part :
$(".typeahead").typeahead({
name : 'resultArticle',
remote : {
url: '/ajax/articles?query=%QUERY',
filter: function(data) {
var resultList = data.aaData.map(function (item) {
return item.name;
});
return process(resultList);
}
}
});
The call to the json is ok, but there is no return, I have no idea what I can do to debug/find solution.
Thanks!