{"action":"created","issue":{"url":"https://api.github.com/repos/RubaXa/Sortable/issues/194","labels_url":"https://api.github.com/repos/RubaXa/Sortable/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/RubaXa/Sortable/issues/194/comments","events_url":"https://api.github.com/repos/RubaXa/Sortable/issues/194/events","html_url":"https://github.com/RubaXa/Sortable/issues/194","id":52663914,"number":194,"title":"Add array support for Meteor","user":{"login":"dedcode","id":960829,"avatar_url":"https://avatars.githubusercontent.com/u/960829?v=3","gravatar_id":"","url":"https://api.github.com/users/dedcode","html_url":"https://github.com/dedcode","followers_url":"https://api.github.com/users/dedcode/followers","following_url":"https://api.github.com/users/dedcode/following{/other_user}","gists_url":"https://api.github.com/users/dedcode/gists{/gist_id}","starred_url":"https://api.github.com/users/dedcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dedcode/subscriptions","organizations_url":"https://api.github.com/users/dedcode/orgs","repos_url":"https://api.github.com/users/dedcode/repos","events_url":"https://api.github.com/users/dedcode/events{/privacy}","received_events_url":"https://api.github.com/users/dedcode/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RubaXa/Sortable/labels/%E2%98%84%20meteor","name":"☄ meteor","color":"f7c6c7"}],"state":"open","locked":false,"assignee":{"login":"dandv","id":33569,"avatar_url":"https://avatars.githubusercontent.com/u/33569?v=3","gravatar_id":"","url":"https://api.github.com/users/dandv","html_url":"https://github.com/dandv","followers_url":"https://api.github.com/users/dandv/followers","following_url":"https://api.github.com/users/dandv/following{/other_user}","gists_url":"https://api.github.com/users/dandv/gists{/gist_id}","starred_url":"https://api.github.com/users/dandv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dandv/subscriptions","organizations_url":"https://api.github.com/users/dandv/orgs","repos_url":"https://api.github.com/users/dandv/repos","events_url":"https://api.github.com/users/dandv/events{/privacy}","received_events_url":"https://api.github.com/users/dandv/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2014-12-22T16:20:27Z","updated_at":"2015-07-16T03:16:09Z","closed_at":null,"body":"I know that this is listed in the todos. However can you point to a quick an dirty way of handling sorting within an array.\r\nI am passing to my template 1 object which has an array, this one is then rendered into a list.\r\nI tried to swap elements onSort, then update my Object:\r\n```\r\n            var tmplist = doc.list;\r\n            var tmp = tmplist[event.oldIndex -1];\r\n            tmplist[event.oldIndex -1] = tmplist[event.newIndex -1];\r\n            tmplist[event.newIndex -1] = tmp;\r\n            Lists.update({_id:Session.get('object_id')}, {$set: {list: tmplist}});\r\n```\r\nBut then something very strange happens, the displayed list is immediately reset to original order. The collection however is updated, only when I refresh the page the order is correct. \r\nI tried to set the option store:false, It didn't help.\r\n\r\nAny advices on how to achieve that ?"},"comment":{"url":"https://api.github.com/repos/RubaXa/Sortable/issues/comments/121814419","html_url":"https://github.com/RubaXa/Sortable/issues/194#issuecomment-121814419","issue_url":"https://api.github.com/repos/RubaXa/Sortable/issues/194","id":121814419,"user":{"login":"skosch","id":554383,"avatar_url":"https://avatars.githubusercontent.com/u/554383?v=3","gravatar_id":"","url":"https://api.github.com/users/skosch","html_url":"https://github.com/skosch","followers_url":"https://api.github.com/users/skosch/followers","following_url":"https://api.github.com/users/skosch/following{/other_user}","gists_url":"https://api.github.com/users/skosch/gists{/gist_id}","starred_url":"https://api.github.com/users/skosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skosch/subscriptions","organizations_url":"https://api.github.com/users/skosch/orgs","repos_url":"https://api.github.com/users/skosch/repos","events_url":"https://api.github.com/users/skosch/events{/privacy}","received_events_url":"https://api.github.com/users/skosch/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T03:16:09Z","updated_at":"2015-07-16T03:16:09Z","body":"This would indeed be helpful ­– for everyone reading this until then, the vanilla Sortable works perfectly fine (just wrap the items in `{{#each}} ... {{/each}}` instead of `{{#sortable}} ... {{/sortable}}` and call `Sortable.create(element, options)`, including an `onEnd` callback, from within `Template.YourTemplate.onRendered`)."}}