{"action":"created","issue":{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/263","repository_url":"https://api.github.com/repos/running-coder/jquery-typeahead","labels_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/263/comments","events_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/263/events","html_url":"https://github.com/running-coder/jquery-typeahead/issues/263","id":192467997,"number":263,"title":"Struggling with AJAX","user":{"login":"jtabachnick","id":8077025,"avatar_url":"https://avatars.githubusercontent.com/u/8077025?v=3","gravatar_id":"","url":"https://api.github.com/users/jtabachnick","html_url":"https://github.com/jtabachnick","followers_url":"https://api.github.com/users/jtabachnick/followers","following_url":"https://api.github.com/users/jtabachnick/following{/other_user}","gists_url":"https://api.github.com/users/jtabachnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jtabachnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtabachnick/subscriptions","organizations_url":"https://api.github.com/users/jtabachnick/orgs","repos_url":"https://api.github.com/users/jtabachnick/repos","events_url":"https://api.github.com/users/jtabachnick/events{/privacy}","received_events_url":"https://api.github.com/users/jtabachnick/received_events","type":"User","site_admin":false},"labels":[{"id":123897286,"url":"https://api.github.com/repos/running-coder/jquery-typeahead/labels/Support","name":"Support","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-30T03:42:40Z","updated_at":"2016-11-30T13:07:36Z","closed_at":null,"body":"I was trying to work off the example for User V1 on the coderunner site, and I have not been able to get anything to display. The response comes in fine and I have gotten to the point where there are no errors showing up with debug set to true, but I don't understand why nothing is happening with the search bar. \r\n\r\nhere is my JSON response: \r\n```JSON\r\n{\"error\":null,\"status\":true,\"data\":[\r\n    {\"name\":\"go pro 1\",\"sku\":\"abc\",\"listingid\":\"110525893\"},\r\n    {\"name\":\"go pro 2\",\"sku\":\"def\",\"listingid\":\"110525880\"},\r\n    {\"name\":\"go pro 3\",\"sku\":\"ghi\",\"listingid\":\"110525888\"},\r\n    {\"name\":\"go pro 4\",\"sku\":\"klm\",\"listingid\":\"110525892\"},\r\n    {\"name\":\"go pro 5\",\"sku\":\"nop\",\"listingid\":\"110530928\"},\r\n    {\"name\":\"go pro 6\",\"sku\":\"qrs\",\"listingid\":\"110530936\"},\r\n    {\"name\":\"go pro 7\",\"sku\":\"tuv\",\"listingid\":\"110530940\"}\r\n]}\r\n```\r\n\r\nand here is the code for set up. \r\n```javascript\r\n$.typeahead({\r\n        input: \"#headerMenuControl_menuSearchTextBox\",\r\n        dynamic: true,\r\n        minLength: 1,\r\n        emptyTemplate: 'No result for {{query}}',\r\n        display: \"sku\",\r\n        source: {\r\n            all: {\r\n                ajax: function (query) {\r\n                    return {\r\n                        type: \"POST\",\r\n                        url: \"listing/search\",\r\n                        path:\"data\",\r\n                        data: {q: \"{{query}}\"}\r\n                    }\r\n                },\r\n                template: '<div style=\"border:1px solid red\">{{sku}}</div>'\r\n            }\r\n        },\r\n        callback: {\r\n            onClick: function (node, a, item, event) {\r\n\r\n                // You can do a simple window.location of the item.href\r\n                alert(JSON.stringify(item));\r\n            },\r\n            onSendRequest: function (node, query) {\r\n                console.log(query);\r\n            },\r\n            onReceiveRequest: function (node, query) {\r\n                console.log('request is received');\r\n            }\r\n        },\r\n        debug: true\r\n    });\r\n}\r\n```\r\n\r\nI have also tried this alternative:\r\n\r\n```javascript\r\ndisplay: \"data\",\r\n    source: {\r\n        all: {\r\n            ajax: function (query) {\r\n                 return {\r\n                     type: \"POST\",\r\n                      url: \"listing/search\",\r\n                      data: {q: \"{{query}}\"}\r\n             }\r\n         },\r\n         template: '<div style=\"border:1px solid red\">{{sku}}</div>'\r\n   }\r\n```\r\n\r\nAny help anyone can provide would be greatly appreciated. "},"comment":{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/comments/263868941","html_url":"https://github.com/running-coder/jquery-typeahead/issues/263#issuecomment-263868941","issue_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/263","id":263868941,"user":{"login":"jtabachnick","id":8077025,"avatar_url":"https://avatars.githubusercontent.com/u/8077025?v=3","gravatar_id":"","url":"https://api.github.com/users/jtabachnick","html_url":"https://github.com/jtabachnick","followers_url":"https://api.github.com/users/jtabachnick/followers","following_url":"https://api.github.com/users/jtabachnick/following{/other_user}","gists_url":"https://api.github.com/users/jtabachnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jtabachnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtabachnick/subscriptions","organizations_url":"https://api.github.com/users/jtabachnick/orgs","repos_url":"https://api.github.com/users/jtabachnick/repos","events_url":"https://api.github.com/users/jtabachnick/events{/privacy}","received_events_url":"https://api.github.com/users/jtabachnick/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T13:07:36Z","updated_at":"2016-11-30T13:07:36Z","body":"@running-coder I am getting the JSON back from my API. I copy pasted that from my network tab. I get no response from the input when I enter something in the text box. In the console I get the log of the query string, and that I get a response as expected based on the callbacks. Is it possible that another plug-in is interfering with the typeahead plug-in?"}}
{"actor":{"display_login":"jtabachnick"}}