Skip to content

Instantly share code, notes, and snippets.

@alimoshen
Last active January 30, 2018 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alimoshen/9d84bf2b6fb4f8232dc10d89e5a00686 to your computer and use it in GitHub Desktop.
Save alimoshen/9d84bf2b6fb4f8232dc10d89e5a00686 to your computer and use it in GitHub Desktop.
Profile listing using easyAutocomplete
//Easy Autocomplete Options
var options = {
url: "datafeed.json",
getValue: "searchfield",
list: {
match: { enabled: true },
onShowListEvent: function() {
$("input[name='profileFinder']").on("input", mark);
}
},
template: {
type: "custom",
method: function(value, item) {
return "<div class='profileResult' onclick=location.href='" + item.url +"';><a href='"+ item.url+"'>"+
"<div class='profileImage'><img src='" + item.picture + "' /></div>"+
"<div class='profileText'><h3>"+ item.name +"</h3><h4> "+ item.role +" </h4><p>"+ item.expertise +"</p>"+
"</a></div>";
}
}
};
//Load Easy Autocomplete
$("#lawyerFinder").easyAutocomplete(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment