{"action":"created","issue":{"url":"https://api.github.com/repos/selectize/selectize.js/issues/1079","repository_url":"https://api.github.com/repos/selectize/selectize.js","labels_url":"https://api.github.com/repos/selectize/selectize.js/issues/1079/labels{/name}","comments_url":"https://api.github.com/repos/selectize/selectize.js/issues/1079/comments","events_url":"https://api.github.com/repos/selectize/selectize.js/issues/1079/events","html_url":"https://github.com/selectize/selectize.js/issues/1079","id":160049970,"number":1079,"title":"How to dynamically update options on type","user":{"login":"caseymct","id":481664,"avatar_url":"https://avatars.githubusercontent.com/u/481664?v=3","gravatar_id":"","url":"https://api.github.com/users/caseymct","html_url":"https://github.com/caseymct","followers_url":"https://api.github.com/users/caseymct/followers","following_url":"https://api.github.com/users/caseymct/following{/other_user}","gists_url":"https://api.github.com/users/caseymct/gists{/gist_id}","starred_url":"https://api.github.com/users/caseymct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseymct/subscriptions","organizations_url":"https://api.github.com/users/caseymct/orgs","repos_url":"https://api.github.com/users/caseymct/repos","events_url":"https://api.github.com/users/caseymct/events{/privacy}","received_events_url":"https://api.github.com/users/caseymct/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/selectize/selectize.js/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-13T21:32:25Z","updated_at":"2016-06-28T18:14:42Z","closed_at":null,"body":"We are using selectize to allow a user to add hashtags to a post. When the widget is initialized, I make a request to the server that populates the dropdown with trending hashtags. Then, as the user types, I would like to update the options to show tags that match their search. e.g. (this is used in Ember)\r\n\r\n```\r\nlet s = input.selectize({\r\n   searchField: ['name'],\r\n   preload: true,\r\n   options: [],\r\n   create: function(input, callback) {\r\n   },\r\n   render: {\r\n      option: function (item, escape) {\r\n         return '<div>' + escape(item.text) + '</div>';\r\n      }\r\n   },\r\n   load: (query, callback) => {\r\n     if (!query.length) {\r\n        return this.initializeFromTrendingTags().then((options) =>  {\r\n           // returns an array of options [{ text: ..., value: ... }, ...]\r\n           callback(options);\r\n        });\r\n     }\r\n     // searchTags also returns an array of matched options in format [{ text: ..., value: ... }, ...]\r\n     return this.searchTags(query).then((options) => {\r\n        callback(options);\r\n     });\r\n  }\r\n})\r\n```\r\n\r\nWhere searchTags issues the api request and updates the options. \r\nHowever, no matter what I do I can't seem to get the options to update. Ideally I'd like the dropdown to change while open to the matched tags. I've tried doing the following:\r\n\r\n```\r\nselectize.clearCache('option');\r\nselectize.clearOptions();\r\nselectize.addOption(options);\r\nselectize.refreshOptions(true);\r\n```\r\n\r\nbut this just clears out the options altogether. I'm stuck. any help? \r\nthanks!!!"},"comment":{"url":"https://api.github.com/repos/selectize/selectize.js/issues/comments/229135178","html_url":"https://github.com/selectize/selectize.js/issues/1079#issuecomment-229135178","issue_url":"https://api.github.com/repos/selectize/selectize.js/issues/1079","id":229135178,"user":{"login":"Cr1stal","id":791399,"avatar_url":"https://avatars.githubusercontent.com/u/791399?v=3","gravatar_id":"","url":"https://api.github.com/users/Cr1stal","html_url":"https://github.com/Cr1stal","followers_url":"https://api.github.com/users/Cr1stal/followers","following_url":"https://api.github.com/users/Cr1stal/following{/other_user}","gists_url":"https://api.github.com/users/Cr1stal/gists{/gist_id}","starred_url":"https://api.github.com/users/Cr1stal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cr1stal/subscriptions","organizations_url":"https://api.github.com/users/Cr1stal/orgs","repos_url":"https://api.github.com/users/Cr1stal/repos","events_url":"https://api.github.com/users/Cr1stal/events{/privacy}","received_events_url":"https://api.github.com/users/Cr1stal/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T18:14:42Z","updated_at":"2016-06-28T18:14:42Z","body":"+1"}}
{"actor":{"display_login":"Cr1stal"}}