{"action":"created","issue":{"url":"https://api.github.com/repos/select2/select2/issues/3008","labels_url":"https://api.github.com/repos/select2/select2/issues/3008/labels{/name}","comments_url":"https://api.github.com/repos/select2/select2/issues/3008/comments","events_url":"https://api.github.com/repos/select2/select2/issues/3008/events","html_url":"https://github.com/select2/select2/issues/3008","id":56721896,"number":3008,"title":"[select2 4.0.0-beta3] Display a link to add a new item if no results are found","user":{"login":"ianlamb77","id":5383580,"avatar_url":"https://avatars.githubusercontent.com/u/5383580?v=3","gravatar_id":"","url":"https://api.github.com/users/ianlamb77","html_url":"https://github.com/ianlamb77","followers_url":"https://api.github.com/users/ianlamb77/followers","following_url":"https://api.github.com/users/ianlamb77/following{/other_user}","gists_url":"https://api.github.com/users/ianlamb77/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlamb77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlamb77/subscriptions","organizations_url":"https://api.github.com/users/ianlamb77/orgs","repos_url":"https://api.github.com/users/ianlamb77/repos","events_url":"https://api.github.com/users/ianlamb77/events{/privacy}","received_events_url":"https://api.github.com/users/ianlamb77/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/select2/select2/milestones/5","html_url":"https://github.com/select2/select2/milestones/4.0.0","labels_url":"https://api.github.com/repos/select2/select2/milestones/5/labels","id":152312,"number":5,"title":"4.0.0","description":"This will be a complete rebuild of Select2, from the ground up.\r\n\r\n**Alpha** The Select2 4.0-alpha.1 release should be done by December 15th, 2014.\r\n\r\n**Beta:** The Select2 4.0-beta.1 release should be done by January 7th, 2014.","creator":{"login":"ivaynberg","id":150030,"avatar_url":"https://avatars.githubusercontent.com/u/150030?v=3","gravatar_id":"","url":"https://api.github.com/users/ivaynberg","html_url":"https://github.com/ivaynberg","followers_url":"https://api.github.com/users/ivaynberg/followers","following_url":"https://api.github.com/users/ivaynberg/following{/other_user}","gists_url":"https://api.github.com/users/ivaynberg/gists{/gist_id}","starred_url":"https://api.github.com/users/ivaynberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivaynberg/subscriptions","organizations_url":"https://api.github.com/users/ivaynberg/orgs","repos_url":"https://api.github.com/users/ivaynberg/repos","events_url":"https://api.github.com/users/ivaynberg/events{/privacy}","received_events_url":"https://api.github.com/users/ivaynberg/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":98,"state":"closed","created_at":"2012-07-26T15:56:40Z","updated_at":"2015-08-28T19:48:29Z","due_on":"2015-01-31T05:00:00Z","closed_at":"2015-04-27T14:49:30Z"},"comments":7,"created_at":"2015-02-05T20:06:26Z","updated_at":"2015-10-21T22:13:03Z","closed_at":"2015-02-07T00:48:23Z","body":"In previous versions, the formatNoMatches option could be used to provide a link to add a new item if no matches were found: \r\n\r\n```\r\nformatNoMatches: function(term) {\r\n  return \"<a href='add_item?term=\"+term+\"' class='new_item'>Add New Item</a>\";\r\n }\r\n```\r\n\r\nHowever when trying to replicate this using 4.0-beta3's new languages.noResults function: \r\n```\r\nlanguage: {\r\n  noResults: function() {\r\n    return \"<a href='some_URL' class='new_item'>Add New Item</a>\";\r\n }\r\n}\r\n```\r\nthe raw unformatted string appears in the dropdown, rather than a link. Manually creating a DOM object in the function and returning that also doesn't work, though I wouldn't really expect it to. Is there another way to achieve this functionality in 4.0?  Thanks."},"comment":{"url":"https://api.github.com/repos/select2/select2/issues/comments/150039661","html_url":"https://github.com/select2/select2/issues/3008#issuecomment-150039661","issue_url":"https://api.github.com/repos/select2/select2/issues/3008","id":150039661,"user":{"login":"JNajera","id":616661,"avatar_url":"https://avatars.githubusercontent.com/u/616661?v=3","gravatar_id":"","url":"https://api.github.com/users/JNajera","html_url":"https://github.com/JNajera","followers_url":"https://api.github.com/users/JNajera/followers","following_url":"https://api.github.com/users/JNajera/following{/other_user}","gists_url":"https://api.github.com/users/JNajera/gists{/gist_id}","starred_url":"https://api.github.com/users/JNajera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JNajera/subscriptions","organizations_url":"https://api.github.com/users/JNajera/orgs","repos_url":"https://api.github.com/users/JNajera/repos","events_url":"https://api.github.com/users/JNajera/events{/privacy}","received_events_url":"https://api.github.com/users/JNajera/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T22:13:03Z","updated_at":"2015-10-21T22:13:03Z","body":"Its any workaround to provide a link to add a new item on the top of the results? I need a fixed option so its always available to the user, but I couldn't figure out how to do it. Im using a custom dataAdapter to set some records when the user open the select. "}}