I am using jquery auto complete for auto suggestion. The suggestion drop down is showing entire list instead of filtered list.
fiddle - http://jsfiddle.net/joshi101/zn609sdj/7/
HTML
<input type='text' />
jquery
var json = [{"full_name": "joye dave", "username": "jd"}, {"full_name": "rob", "username": "r"}, {"full_name": "jhon key", "username": "jk"}, {"full_name": "alpacino", "username": "ap"}, {"full_name": "Julia", "username": "Julia"}];
$('input').autocomplete({
source: function (request, response) {
response( $.map( json , function(i){
return{
id: i.username,
value: i.full_name
}
}))
},
focus: function( event, ui ) {
$( "input" ).val( ui.item.id );
return false;
},
});
I have seen similar code working during my search but not getting any clue why this isn't working.