我使用EasyAutocomplete插件自动完成搜索框,插件工作良好,当我只搜索一种类型。我的意思是,我只有一个选项可供搜索,而我希望可以使用多个值进行搜索,即按名称或姓氏等进行搜索。
这是我的代码:
var options = {
url: "https://coincap.io/front",
getValue: "long",
template: {
type: "description",
fields: {
description: "short"
}
},
list: {
match: {
enabled: true
},
},
theme: "plate-dark"
};
$("#searching").easyAutocomplete(options);现在这是api,我从那里得到密码货币的值,目前我用它的long名称进行搜索,它工作得很好,但是我也想用short名称进行搜索。
对不起我的英语不好..。我希望你有我的问题。谢谢
发布于 2017-12-31 16:39:18
这个插件允许使用函数,通过函数您可以这样做。
var options = {
url: "https://coincap.io/front",
getValue: function(element){
return element.long+" - "+element.short;
},
/*
template: {
type: "description",
fields: {
description: "short"
}
}, */
list: {
match: {
enabled: true
},
},
theme: "plate-dark"
};
$("#searching").easyAutocomplete(options);https://stackoverflow.com/questions/48002947
复制相似问题