0

I am using Bootstrap tokenfield with jQuery UI autocomplete. But the list is not displaying any thing except blank fields.

This is my code:

$('#country').tokenfield({
   autocomplete: {
      source: "/country", minLength: 1
   },
   showAutocompleteOnFocus: true
});

Source is returning appropriate data but the autocomplete suggestion is blank.

Is there any fix for this or am i missing something in my code? Please help me with this.

Data returned from source(when I type ind):-

[
   {"id":"1","dat":"India"},   
   {"id":"2","dat":"Indonesia"}              
]

Thanks

Mannu Nayyar
  • 193
  • 1
  • 5
  • 21
  • empty or response number blank entries, is your source is returning the data is correct format expected by the auto complete – Raj Feb 07 '17 at 14:11
  • ya @Raj the source is returning data in correct format. I edited the question and added the returned data. Please check – Mannu Nayyar Feb 07 '17 at 14:18

1 Answers1

0

the data returned should be of this format

[
   {"value":"1","label":"India"},   
   {"value":"2","label":"Indonesia"}              
]
Raj
  • 1,156
  • 11
  • 15