Necesito filtrar por mas de un campo , actualmente puedo filtrar solo por "name" pero tambien necesito poder filtrar por "code", no he encontrado en la documentación la forma de hacer esto , he intentado agregar mas de un "getValue" pero no encuentro la forma correcta de realizar esto gracias
he intentado reemplazar getValue por esto sin resultados:
getValue: function(element) {
return $(element).find("name").text() + " " + $(element).find("code").text();
}
getValue: function(element) {
return element["code"]["name"];
},
var options = {
data: [{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Aland Islands",
"code": "AX"
},
{
"name": "Albania",
"code": "AL"
},
{
"name": "Algeria",
"code": "DZ"
},
{
"name": "American Samoa",
"code": "AS"
},
],
getValue: "name",
list: {
match: {
enabled: true
}
}
};
$("#provider-json").easyAutocomplete(options);
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.themes.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js"></script>
<input id="provider-json" />