{"action":"created","issue":{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/158","repository_url":"https://api.github.com/repos/running-coder/jquery-typeahead","labels_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/158/comments","events_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/158/events","html_url":"https://github.com/running-coder/jquery-typeahead/issues/158","id":136346512,"number":158,"title":"Dynamically updating items","user":{"login":"Guntiss","id":9088411,"avatar_url":"https://avatars.githubusercontent.com/u/9088411?v=3","gravatar_id":"","url":"https://api.github.com/users/Guntiss","html_url":"https://github.com/Guntiss","followers_url":"https://api.github.com/users/Guntiss/followers","following_url":"https://api.github.com/users/Guntiss/following{/other_user}","gists_url":"https://api.github.com/users/Guntiss/gists{/gist_id}","starred_url":"https://api.github.com/users/Guntiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guntiss/subscriptions","organizations_url":"https://api.github.com/users/Guntiss/orgs","repos_url":"https://api.github.com/users/Guntiss/repos","events_url":"https://api.github.com/users/Guntiss/events{/privacy}","received_events_url":"https://api.github.com/users/Guntiss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/labels/Dynamic%20Source","name":"Dynamic Source","color":"5319e7"},{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/labels/New%20Feature","name":"New Feature","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/milestones/6","html_url":"https://github.com/running-coder/jquery-typeahead/milestones/2.4.0","labels_url":"https://api.github.com/repos/running-coder/jquery-typeahead/milestones/6/labels","id":1461792,"number":6,"title":"2.4.0","description":null,"creator":{"login":"running-coder","id":7377382,"avatar_url":"https://avatars.githubusercontent.com/u/7377382?v=3","gravatar_id":"","url":"https://api.github.com/users/running-coder","html_url":"https://github.com/running-coder","followers_url":"https://api.github.com/users/running-coder/followers","following_url":"https://api.github.com/users/running-coder/following{/other_user}","gists_url":"https://api.github.com/users/running-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/running-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/running-coder/subscriptions","organizations_url":"https://api.github.com/users/running-coder/orgs","repos_url":"https://api.github.com/users/running-coder/repos","events_url":"https://api.github.com/users/running-coder/events{/privacy}","received_events_url":"https://api.github.com/users/running-coder/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2015-12-15T18:33:01Z","updated_at":"2016-02-25T20:12:02Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-02-25T10:36:36Z","updated_at":"2016-02-29T10:18:19Z","closed_at":null,"body":"Hello! My project requires updating items dynamically. I am achieving this by modifying object throught\r\n\r\n> window.Typeahead['#input_query'].source.inventory\r\n\r\nBut for changes to appear I need to trigger search using\r\n> $('#input_query').trigger('input.typeahead');\r\n\r\nIssue with this is that it redraws everything and therefore causes scrolling to top of the page. Is there any way to achieve updating without causing scrolling?\r\nFurther on I am planning to implement live item updating through socket connection, so that all online users see changes immediately.\r\n\r\nI tried updating object and DOM elements directly, it works, but the problem is, I can't find any way to reuse template that generates every entry."},"comment":{"url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/comments/190140871","html_url":"https://github.com/running-coder/jquery-typeahead/issues/158#issuecomment-190140871","issue_url":"https://api.github.com/repos/running-coder/jquery-typeahead/issues/158","id":190140871,"user":{"login":"Guntiss","id":9088411,"avatar_url":"https://avatars.githubusercontent.com/u/9088411?v=3","gravatar_id":"","url":"https://api.github.com/users/Guntiss","html_url":"https://github.com/Guntiss","followers_url":"https://api.github.com/users/Guntiss/followers","following_url":"https://api.github.com/users/Guntiss/following{/other_user}","gists_url":"https://api.github.com/users/Guntiss/gists{/gist_id}","starred_url":"https://api.github.com/users/Guntiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Guntiss/subscriptions","organizations_url":"https://api.github.com/users/Guntiss/orgs","repos_url":"https://api.github.com/users/Guntiss/repos","events_url":"https://api.github.com/users/Guntiss/events{/privacy}","received_events_url":"https://api.github.com/users/Guntiss/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T10:18:19Z","updated_at":"2016-02-29T10:18:19Z","body":"I am using Game V3 example. Scrolling is caused because resetLayout sets container content to empty. I managed to fix scrolling issue using simple fix. Saving scroll position before resetting layout\r\n\r\n> scroll_t = $('body').scrollTop();\r\n> this.resetLayout();\r\n\r\nand loading scroll position at the end of searchResult()\r\n> $('body').scrollTop(scroll_t);\r\n\r\nAll callbacks ar executed after resetLayout(), so I had no choice to modify source code.\r\nI think this should be definitely implemented in plugin :) \r\n\r\n"}}