{"issue":{"title":"layout manager loses event subscriptions?","user":{"login":"sontek","id":151924,"url":"https://api.github.com/users/sontek","avatar_url":"https://secure.gravatar.com/avatar/848c8fa8f54256aa570becc90123bee2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"848c8fa8f54256aa570becc90123bee2"},"created_at":"2011-12-28T22:10:05Z","milestone":null,"state":"open","updated_at":"2011-12-29T04:10:50Z","labels":[],"id":2675250,"closed_at":null,"html_url":"https://github.com/tbranyen/backbone.layoutmanager/issues/23","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I have a single view that is bound to a collection:    \r\n\r\n    Permissions.Views.UserList = Backbone.LayoutManager.View.extend({\r\n            template: 'userlist',\r\n\r\n            events: {\r\n                'click': 'select'\r\n            },\r\n\r\n            initialize: function() {\r\n                this.collection.bind(\"all\", function() {\r\n                        this.render();\r\n                    }, this);\r\n            },\r\n\r\n            serialize: function() {\r\n                return { users: this.collection.toJSON() };\r\n            },\r\n\r\n            select: function() {\r\n                console.log('select');\r\n            }\r\n        });\r\n\r\n\r\n\r\nThe 'select' function is never called because of the collection bind in intialize.  If I comment out the initialize the select fires just fine.","number":23,"url":"https://api.github.com/repos/tbranyen/backbone.layoutmanager/issues/23","comments":2,"assignee":null},"comment":{"user":{"login":"sontek","id":151924,"url":"https://api.github.com/users/sontek","avatar_url":"https://secure.gravatar.com/avatar/848c8fa8f54256aa570becc90123bee2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"848c8fa8f54256aa570becc90123bee2"},"created_at":"2011-12-29T04:10:50Z","updated_at":"2011-12-29T04:10:50Z","id":3297962,"body":"The bug is definitely something with async, I changed the fetch to:\r\n\r\n    fetch: function(path) {\r\n        var html = $.ajax({\r\n            url: path + '.html',\r\n            async: false\r\n        }).responseText;\r\n\r\n        return html;\r\n    },\r\n\r\nand all works.\r\n\r\n","url":"https://api.github.com/repos/tbranyen/backbone.layoutmanager/issues/comments/3297962"},"action":"created"}