{"action":"created","issue":{"url":"https://api.github.com/repos/twitter/typeahead.js/issues/300","labels_url":"https://api.github.com/repos/twitter/typeahead.js/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/twitter/typeahead.js/issues/300/comments","events_url":"https://api.github.com/repos/twitter/typeahead.js/issues/300/events","html_url":"https://github.com/twitter/typeahead.js/issues/300","id":15852556,"number":300,"title":"Example of typeahead:selected event","user":{"login":"andy3rdworld","id":4616502,"avatar_url":"https://avatars.githubusercontent.com/u/4616502?v=3","gravatar_id":"","url":"https://api.github.com/users/andy3rdworld","html_url":"https://github.com/andy3rdworld","followers_url":"https://api.github.com/users/andy3rdworld/followers","following_url":"https://api.github.com/users/andy3rdworld/following{/other_user}","gists_url":"https://api.github.com/users/andy3rdworld/gists{/gist_id}","starred_url":"https://api.github.com/users/andy3rdworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy3rdworld/subscriptions","organizations_url":"https://api.github.com/users/andy3rdworld/orgs","repos_url":"https://api.github.com/users/andy3rdworld/repos","events_url":"https://api.github.com/users/andy3rdworld/events{/privacy}","received_events_url":"https://api.github.com/users/andy3rdworld/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2013-06-21T14:04:57Z","updated_at":"2015-05-27T08:26:25Z","closed_at":"2013-06-26T01:09:36Z","body":"For anyone interested until an example is added to documentation for custom events...\r\n\r\nAssuming there's an input on your page called 'search_input':\r\n\r\n```javascript\r\n\r\n$('#search_input').bind('typeahead:selected', function(obj, datum, name) {\t\t\r\n        alert(JSON.stringify(obj)); // object\r\n\t\t// outputs, e.g., {\"type\":\"typeahead:selected\",\"timeStamp\":1371822938628,\"jQuery19105037956037711017\":true,\"isTrigger\":true,\"namespace\":\"\",\"namespace_re\":null,\"target\":{\"jQuery19105037956037711017\":46},\"delegateTarget\":{\"jQuery19105037956037711017\":46},\"currentTarget\":\r\n\t\talert(JSON.stringify(datum)); // contains datum value, tokens and custom fields\r\n\t\t// outputs, e.g., {\"redirect_url\":\"http://localhost/test/topic/test_topic\",\"image_url\":\"http://localhost/test/upload/images/t_FWnYhhqd.jpg\",\"description\":\"A test description\",\"value\":\"A test value\",\"tokens\":[\"A\",\"test\",\"value\"]}\r\n\t\t// in this case I created custom fields called 'redirect_url', 'image_url', 'description'\t\r\n                \r\n\t\talert(JSON.stringify(name)); // contains dataset name\r\n\t\t// outputs, e.g., \"my_dataset\"\r\n\t\r\n});\r\n```\r\n\r\nhttps://github.com/twitter/typeahead.js#custom-events"},"comment":{"url":"https://api.github.com/repos/twitter/typeahead.js/issues/comments/105821556","html_url":"https://github.com/twitter/typeahead.js/issues/300#issuecomment-105821556","issue_url":"https://api.github.com/repos/twitter/typeahead.js/issues/300","id":105821556,"user":{"login":"allesan","id":8148733,"avatar_url":"https://avatars.githubusercontent.com/u/8148733?v=3","gravatar_id":"","url":"https://api.github.com/users/allesan","html_url":"https://github.com/allesan","followers_url":"https://api.github.com/users/allesan/followers","following_url":"https://api.github.com/users/allesan/following{/other_user}","gists_url":"https://api.github.com/users/allesan/gists{/gist_id}","starred_url":"https://api.github.com/users/allesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allesan/subscriptions","organizations_url":"https://api.github.com/users/allesan/orgs","repos_url":"https://api.github.com/users/allesan/repos","events_url":"https://api.github.com/users/allesan/events{/privacy}","received_events_url":"https://api.github.com/users/allesan/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T08:26:25Z","updated_at":"2015-05-27T08:26:25Z","body":"Am I wrong or this is not working anymore?"}}