loopj/jquery-tokeninput — pull request #277 by jaideep87 (2012-02-13 07:04:18+00:00)
Title: Dynamic Data Source

Firstly i want to congratulate loopj on Making just a beautiful Plugin
Recently i needed to integrate tokenInput Plugin with GMAP3 plugin(http://gmap3.net/examples/address-lookup.html)
But currently it can only have source as
oblject
url
Dynamic url function // NOTE:it can only compute url dynamically ,not response object

so i Have Made a attempt To Fetch Response Data Dynamically From Function With Asynchronous callback of GMAP3 (This is why i need to create Display() function)

it Can be used this way (eg. of GMAP3)

function googleFetch(query){
var googleData=[];
if(typeof query != 'undefined'){
$("#test").gmap3({
action:'getAddress',
address:query,
callback:function(results){
for (var i = 0; i < results.length; i++) {
googleData.push({"name": results[i].formatted_address});
}
$("#input-field").tokenInput("display",googleData,query);
}
});
}

$("#location-select").tokenInput(
googleFetch
, {
tokenValue: "name",
dynamicSource:true,
});

All For the Sake of if Somebody needed to do something like this
code is working Bug Free for Me,But Certainly be refined