Created
September 6, 2012 05:18
-
-
Save athom/3651596 to your computer and use it in GitHub Desktop.
tokeninput callback example
This file contains hidden or 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
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