Last active
January 30, 2018 16:51
-
-
Save alimoshen/9d84bf2b6fb4f8232dc10d89e5a00686 to your computer and use it in GitHub Desktop.
Profile listing using easyAutocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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