I have:
$('.titulares').tokenInput("http://localhost/ajax/ajax.php",{
tokenLimit: 1,
queryParam: 'query',
propertyToSearch: 'nome',
resultsLimit: 2,
tokenValue: 'id',
noResultsText: 'Nada',
searchingText: "Procurando...",
hintText: "Buscar titular",
method: 'GET',
onResult(){
alert('a');
}
});
ajax.php JSON output:
[
{
"id":12,
"nome":"Joe Bill"
},
{
"id":13,
"nome":"PJ"
},
{
"id":14,
"nome":"John"
},
{
"id":16,
"nome":"Acme"
},
{
"id":17,
"nome":"Acme2"
},
{
"id":18,
"nome":"Acme3"
}
]
The code shows loading texts, but the JSON output is not renderized in text field and onResult is not fired
Thanks
your code not work because you write wrong syntax. if you fix it, your code will run normally now.
demo: http://jsbin.com/yimiwumije/edit?html,js,output