loopj/jquery-tokeninput — pull request #354 by raihan2006i (2012-07-13 08:08:11+00:00)
Title: Sending a pull request

I have fixed a Bug and also added a New feature please check and review.

1) Bug fix : Uncaught TypeError: Object [object Object] has no method 'prop'
2) Implemented setOptions() function to Store settings/options in element's data object so that we can change options at anytime.

So that we can do following at anytime
Example:

$(document).ready(function() {
$(element).tokenInput([{
"first_name": "Arthur",
"last_name": "Godfrey",
"email": "arthur_godfrey@nccu.edu",
"url": "https://si0.twimg.com/sticky/default_profile_images/default_profile_2_normal.png"
},
{
"first_name": "Adam",
"last_name": "Johnson",
"email": "wravo@yahoo.com",
"url": "https://si0.twimg.com/sticky/default_profile_images/default_profile_2_normal.png"
}], {propertyToSearch: "first_name"}
);
});

Later we can do followings

$(element).tokenInput("setOptions", {propertyToSearch: 'first_name', hintText: "Type first name here to search"});
$(element).tokenInput("setOptions", {propertyToSearch: 'last_name', hintText: "Type last name here to search"});
$(element).tokenInput("setOptions", {propertyToSearch: 'email', hintText: "Type email here to search"});
$(element).tokenInput("setOptions", {propertyToSearch: 'url', hintText: "Type url here to search"});

Check demo.html file for a demo