javascript - TypeHeadBootStrap does not work -


i have json has following structure:

[{"id":1,"nome":"teste"},{"id":2,"nome":"teste"},{"id":3,"nome":"teste3"}]

i want use head type code not load, in browser console shows loaded json correctly.

$('#nome').typeahead({     source: function(query, process) {         objects = [];         map = {};         console.log(data);         $.each(data, function(i, object) {             map[object.label] = object;             objects.push(object.label);         });         process(objects);     },     updater: function(item) {         console.log(map[item].id);         //$('hiddeninputelement').val(map[item].id);         return item;     } }); 

i using lib: https://github.com/bassjobsen/bootstrap-3-typeahead

resolved changed library https://github.com/biggora/bootstrap-ajax-typeahead


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -