{"action":"created","issue":{"url":"https://api.github.com/repos/select2/select2/issues/3424","labels_url":"https://api.github.com/repos/select2/select2/issues/3424/labels{/name}","comments_url":"https://api.github.com/repos/select2/select2/issues/3424/comments","events_url":"https://api.github.com/repos/select2/select2/issues/3424/events","html_url":"https://github.com/select2/select2/issues/3424","id":82330327,"number":3424,"title":"Possible trigger query bug","user":{"login":"andrewblake1","id":1947758,"avatar_url":"https://avatars.githubusercontent.com/u/1947758?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewblake1","html_url":"https://github.com/andrewblake1","followers_url":"https://api.github.com/users/andrewblake1/followers","following_url":"https://api.github.com/users/andrewblake1/following{/other_user}","gists_url":"https://api.github.com/users/andrewblake1/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewblake1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewblake1/subscriptions","organizations_url":"https://api.github.com/users/andrewblake1/orgs","repos_url":"https://api.github.com/users/andrewblake1/repos","events_url":"https://api.github.com/users/andrewblake1/events{/privacy}","received_events_url":"https://api.github.com/users/andrewblake1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/select2/select2/labels/needs%20information","name":"needs information","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-29T08:27:06Z","updated_at":"2015-05-30T17:51:34Z","closed_at":null,"body":"I think this is a bug - could be just me of course. Am trying to trigger ajax load on a select2 element as per Kevin Brown answer on https://groups.google.com/forum/#!topic/select2/TOh3T0yqYr4.\r\n\r\nIf I click the element it works fine - just thought I would mention. Use case hide if 1, error message on 0 and all good to select if > 1.\r\n\r\nWhere $this is my selected jquery element:\r\n\r\nIf I use ```$this.select2('trigger', 'query', {});``` I get no errors but no ajax request.\r\n\r\nIf I use ```$this.select2('trigger', 'query');``` I get Uncaught TypeError: Cannot read property 'term' of undefined on line 3758 of select2.full.js because query is not defined in \r\n```\r\ncontainer.on('results:all', function (params) {\r\n      if (params.query.term == null || params.query.term === '') {\r\n```\r\nApologies, I have been unable to debug further as the code is a little above me still."},"comment":{"url":"https://api.github.com/repos/select2/select2/issues/comments/107070972","html_url":"https://github.com/select2/select2/issues/3424#issuecomment-107070972","issue_url":"https://api.github.com/repos/select2/select2/issues/3424","id":107070972,"user":{"login":"kevin-brown","id":1991850,"avatar_url":"https://avatars.githubusercontent.com/u/1991850?v=3","gravatar_id":"","url":"https://api.github.com/users/kevin-brown","html_url":"https://github.com/kevin-brown","followers_url":"https://api.github.com/users/kevin-brown/followers","following_url":"https://api.github.com/users/kevin-brown/following{/other_user}","gists_url":"https://api.github.com/users/kevin-brown/gists{/gist_id}","starred_url":"https://api.github.com/users/kevin-brown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevin-brown/subscriptions","organizations_url":"https://api.github.com/users/kevin-brown/orgs","repos_url":"https://api.github.com/users/kevin-brown/repos","events_url":"https://api.github.com/users/kevin-brown/events{/privacy}","received_events_url":"https://api.github.com/users/kevin-brown/received_events","type":"User","site_admin":false},"created_at":"2015-05-30T17:51:34Z","updated_at":"2015-05-30T17:51:34Z","body":"Looking back at the original post, I think the line that triggered me to ask for more information was\r\n\r\n>  I get no errors but no ajax request.\r\n\r\nYou didn't specify what errors were being triggered, and I suspected you were dealing with a hidden input (which has a known bug with AJAX).\r\n\r\n---\r\n\r\nWhen querying for results, the query object (which can be empty, `{}`) is not optional, which explains the errors from the second line of code."}}