{"action":"created","issue":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2441","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2441/labels{/name}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2441/comments","events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2441/events","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2441","id":63455307,"number":2441,"title":"onBeforeAttach and onAttach for CollectionView child views","user":{"login":"ianmstew","id":4119765,"avatar_url":"https://avatars.githubusercontent.com/u/4119765?v=3","gravatar_id":"","url":"https://api.github.com/users/ianmstew","html_url":"https://github.com/ianmstew","followers_url":"https://api.github.com/users/ianmstew/followers","following_url":"https://api.github.com/users/ianmstew/following{/other_user}","gists_url":"https://api.github.com/users/ianmstew/gists{/gist_id}","starred_url":"https://api.github.com/users/ianmstew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianmstew/subscriptions","organizations_url":"https://api.github.com/users/ianmstew/orgs","repos_url":"https://api.github.com/users/ianmstew/repos","events_url":"https://api.github.com/users/ianmstew/events{/privacy}","received_events_url":"https://api.github.com/users/ianmstew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-21T21:08:36Z","updated_at":"2015-03-25T23:05:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2441","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2441","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/2441.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/2441.patch"},"body":"This pull request satisfies the expectation a CollectionView should trigger _onBeforeAttach_ and _onAttach_ on child views it attaches to the DOM, e.g, when calling `collectionView.render()`, in the case where the CollectionView itself is already shown.  Prior to this, as documented in #2209, _onBeforeAttach_ and _onAttach_ were **only** triggered on child views by `Region#show()` during  `region.show(collectionView)`.\r\n\r\nTests cover the new case as well as backfill tests for the case of `region.show(collectionView)` that was already working.\r\n\r\nDiscussion remains for the issue of \"opting out\" of onBeforeAttach and onAttach for newly created child views by an already shown CollectionView.  Ideally, we would have a parallel opt-out to `Region#show()`.  However, when a CollectionView is creating new views outside of a `region.show()`, there is no exact parallel to `Region#show()`'s _showOptions_.  This discussion does not necessarily need to block merging, because this option is not a direct expectation (is not yet documented).\r\n\r\nNote: complexity and maxstatements had to be increased to accommodate `addEmptyView()` and `_addChildView()`, for much the same reason that `Region#show()` requires higher complexity and maxstatements."},"comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/comments/86247987","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2441#issuecomment-86247987","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2441","id":86247987,"user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T23:05:20Z","updated_at":"2015-03-25T23:05:20Z","body":"Just did another pass. This is big, but I really like it. \r\n\r\nAndrew, Christian.  Let's get eyes here. Sam you too :)\r\n\r\n\r\nMind opening against next?"}}