Let say a jQuery TokenInput is attached with a text field with a pre populate parameter defined during its initialization.
Now I want to populate that input field with some tokens on an event trigger without re-initialization of this plugin.
Let say a jQuery TokenInput is attached with a text field with a pre populate parameter defined during its initialization.
Now I want to populate that input field with some tokens on an event trigger without re-initialization of this plugin.
I have found the solution of my work. Thats why I am posting here so that others can benefit from this answer.
Let say Occupation is my field with id "occupation".
$("#occupation").tokenInput("add", {id: 1, name: "Software Engineer"});
"add" is a function which adds the json record as a token on the fly.
Hope it helps.
Thanks