Skip to content

Instantly share code, notes, and snippets.

@athom
Created September 6, 2012 05:18
Show Gist options
  • Save athom/3651596 to your computer and use it in GitHub Desktop.
Save athom/3651596 to your computer and use it in GitHub Desktop.
tokeninput callback example
onLocalSearchResult: function(items, q){
var newItems = new Array();
$.each(items, function(index, item){
names = item.Name.split(" ");
$.each(names, function(i, name){
if(name.toLowerCase().slice(0,q.length) == q){
newItems.push(item);
return false
}
})
});
return newItems;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment