{"action":"created","issue":{"url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/81","labels_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/81/comments","events_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/81/events","html_url":"https://github.com/miguelcobain/ember-cli-selectize/issues/81","id":91921079,"number":81,"title":"Loading content from remote source","user":{"login":"colinhoernig","id":195992,"avatar_url":"https://avatars.githubusercontent.com/u/195992?v=3","gravatar_id":"","url":"https://api.github.com/users/colinhoernig","html_url":"https://github.com/colinhoernig","followers_url":"https://api.github.com/users/colinhoernig/followers","following_url":"https://api.github.com/users/colinhoernig/following{/other_user}","gists_url":"https://api.github.com/users/colinhoernig/gists{/gist_id}","starred_url":"https://api.github.com/users/colinhoernig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinhoernig/subscriptions","organizations_url":"https://api.github.com/users/colinhoernig/orgs","repos_url":"https://api.github.com/users/colinhoernig/repos","events_url":"https://api.github.com/users/colinhoernig/events{/privacy}","received_events_url":"https://api.github.com/users/colinhoernig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-29T22:08:08Z","updated_at":"2015-06-30T08:40:59Z","closed_at":null,"body":"Hi Miguel.  Thank you for the great Selectize addon.\r\n\r\nI'm looking to load selectize options from a remove source in order to build autocomplete functionality based on remote data.  [Here is an example](https://github.com/brianreavis/selectize.js/blob/master/examples/movies.html) of what I'd like to achieve from the Selectize.js docs.  This functionality does not seem to be implemented within the ember-cli-selectize addon.\r\n\r\nI did attempt to use the `update-filter` action to try and build the `content` object array when a user types in the input field, but did not have much luck.\r\n\r\nI'd love to see an example of loading remote data as a source for the selectize control, if possible.\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/comments/117057339","html_url":"https://github.com/miguelcobain/ember-cli-selectize/issues/81#issuecomment-117057339","issue_url":"https://api.github.com/repos/miguelcobain/ember-cli-selectize/issues/81","id":117057339,"user":{"login":"miguelcobain","id":631691,"avatar_url":"https://avatars.githubusercontent.com/u/631691?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelcobain","html_url":"https://github.com/miguelcobain","followers_url":"https://api.github.com/users/miguelcobain/followers","following_url":"https://api.github.com/users/miguelcobain/following{/other_user}","gists_url":"https://api.github.com/users/miguelcobain/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelcobain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelcobain/subscriptions","organizations_url":"https://api.github.com/users/miguelcobain/orgs","repos_url":"https://api.github.com/users/miguelcobain/repos","events_url":"https://api.github.com/users/miguelcobain/events{/privacy}","received_events_url":"https://api.github.com/users/miguelcobain/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T08:40:59Z","updated_at":"2015-06-30T08:40:59Z","body":"I'll show you an example of my own.\r\n\r\nController:\r\n```js\r\nexport default Ember.Controller.extend({\r\n\r\n  streets: function() {\r\n    //fetch streets here. You'll probably want to include your model's street here as well\r\n    var streetFilter = this.get('streetFilter');\r\n\r\n    return DS.PromiseArray.create({\r\n      //do whatever you need to remotely fetch the models, based on the filter\r\n      promise: this.store.find('street', { name: streetFilter })\r\n    });\r\n  }.property('streetFilter', 'model.street'),\r\n\r\n  actions: {\r\n    streetFilterUpdate(str) {\r\n      this.set('streetFilter', str);\r\n    }\r\n  }\r\n});\r\n```\r\nTemplate:\r\n```hbs\r\n{{ember-selectize content=streets selection=model.place\r\n  update-filter=\"streetFilterUpdate\" loading=streets.isPending}}\r\n```\r\n\r\nA loading class will be applied to selectize while the loading is happening. "}}