loopj/jquery-tokeninput — pull request #357 by raihan2006i (2012-07-17 10:41:27+00:00)
Title: Implemented setOptions() function

Store settings/options in element's data object so that we can change option for each element
So that we can change settings at anytime
Following example shows that we can change propertyToSearch and hintText at anytime we want
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/
},
{
"first_name": "Adam",
"last_name": "Johnson",
"email": "wravo@yahoo.com",
"url": "https://si0.twimg.com/sticky/default_profile_images/
}], {propertyToSearch: "first_name"}
);
});

Later we can do followings at anytime

$(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 *Change propertyToSearch anytime* demo in demo.html file