My Jquery Autocomplete using the sample code from JQuery website work with below data from a url
[
"shirt",
"shirt two"
]
But wont work with below data [ data from a url ]
[
{
"id": 1,
"name": "shirt"
},
{
"id": 5,
"name": "shirt two"
}
]
and Here is my JQuery :
<script>
$(function(){
$('#searchbox').autocomplete({
type: "GET",
source:'{% url 'ajitemsdetails' %}',
minLength: 3,
select: function( event, ui ) {
$('#data').append('<tr><td></td><td>'+ui.item.name+'</td><td></td><td></td><td></td><tr>');
}})
});
</script>