{"action":"created","comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/75027514","id":75027514,"diff_hunk":"@@ -977,67 +979,144 @@ var MyCollectionView = Mn.CollectionView.extend({\n });\n ```\n \n-## CollectionView Events and Callbacks\n+## Events\n \n-There are several events that will be triggered during the life\n-of a collection view. Each of these events is called with the\n-[Marionette.triggerMethod](./marionette.functions.md#marionettetriggermethod) function,\n-which calls a corresponding \"on{EventName}\" method on the\n-view instance. Additionally each event is triggered immediately after the action\n-occurred and a before event is triggered immediately prior.\n-The first argument passed to all event handlers is the triggering view.\n+The `CollectionView`, like `View`, is able to trigger and respond to events\n+occurring during their lifecycle. The [Documentation for Events](./events.md)\n+has the complete documentation for how to set and handle events on views.\n \n-### \"render\" / \"before:render\" event\n+### Child Event Bubbling\n \n-Triggers when the `CollectionView` is rendered.\n-You can implement this in your view to provide custom code for dealing\n-with the view's `el` after it has been rendered:\n+When a child view triggers an event, that event will bubble up one level to the\n+parent collection view. For an example:\n \n ```javascript\n var Mn = require('backbone.marionette');\n \n-var MyView = Mn.CollectionView.extend({...});\n-\n-var myView = new MyView();\n+var Item = Mn.View.extend({\n+  tagName: 'li',\n \n-myView.on({\n-  'render': function() {\n-    console.log('this collection view rendered');\n-  },\n-  'before:render': function(){\n-    console.log('the collection view is about to be rendered');\n+  triggers: {\n+    'click a': 'select:item'\n   }\n });\n \n-myView.render();\n+var Collection = Mn.CollectionView.extend({\n+  tagName: 'ul',\n+\n+  onChildviewSelectItem: function(childView) {\n+    console.log('item selected: ' + childView.model.id);\n+  }\n+});\n ```\n \n-### \"render:children\" / \"before:render:children\" event\n+The event will receive a `childview:` prefix before going through the magic\n+method binding logic. See the\n+[Documentation for Child View Events](./events.md#child-view-events) for more\n+information.\n+\n+### Lifecycle Events\n+\n+The `CollectionView` has its own lifecycle around the standard `View` event\n+rendering lifecycle. This section covers the events that get triggered and what\n+they indicate.\n+\n+#### View Creation Lifecycle\n+\n+The `CollectionView` creation lifecycle can go down two paths depending on\n+whether the collection is populated or empty. The below table shows the order of\n+rendering events firing:\n+\n+| Order |           Event          |\n+| :---: |--------------------------|\n+|   1   |      `before:render`     |\n+|  2*   |  `before:render:empty`   |\n+|  2+   | `before:render:children` |\n+|   3   |    `before:add:child`    |\n+|   4   |       `add:child`        |\n+|  5*   |      `render:empty`      |\n+|  5+   |     `render:children`    |\n+|   6   |          `render`        |\n+|   7   |      `before:attach`     |\n+|   8   |         `attach`         |\n+|   9   |       `dom:refresh`      |\n+\n+The events marked with \"\\*\" only fire on empty collections and events marked\n+with \"+\" fire on collections with items.\n+\n+##### Collection `before:render`\n+\n+Triggers before the `CollectionView` render process starts. See the\n+[`before:render` Documentation](#marionette.view.md#view-before-render) for an\n+example.\n+\n+##### Collection `before:render:empty`\n+\n+Triggers just before rendering a collection `emptyView`. This won't be fired if\n+the collection has 1 or more elements in.\n+\n+##### Collection `before:render:children`\n+\n+This event fires just before rendering the children in the `CollectionView`.\n+This only fires if the collection has at least one item.\n+\n+##### Collection `before:add:child`\n+\n+This event fires before each child is added to the view. If the collection is\n+empty, this fires exactly once for the `emptyView`.\n+\n+##### Collection `add:child`\n+\n+This event fires after each child is added to the view. This fires once for each\n+item in the attached collection.\n+\n+If the collection is empty, this event fires exactly once for the `emptyView`.\n+\n+##### Collection `render:empty`\n+\n+This event fires once the `emptyView` has been rendered. This will only fire if\n+the attached collection is empty.\n \n-The `render:children` event is triggered after a `collectionView`'s children have been rendered and buffered. It differs from the `collectionViews`'s `render` event in that it happens __only__ if the `collection` is not not empty. It may also happen when the children sort when [`reorderOnSort`](#collectionviews-reorderonsort) is false.\n+##### Collection `render:children`\n+\n+This event fires once all the collection's child views have been rendered.  This\n+only fires if the collection has at least one item. This may also fire when\n+[`reorderOnSort`](#collectionviews-reorderonsort) is false:\n \n ```javascript\n var Bb = require('backbone');\n var Mn = require('backbone.marionette');\n \n-var MyView = Mn.CollectionView.extend({...});\n+var MyView = Mn.CollectionView.extend({\n+  onRenderChildren: function({\n+    console.log('The collectionview children have been rendered');\n+  })\n+});\n \n var myView = new MyView({\n   collection: new Bb.Collection([{ id: 1 }]);\n });\n \n-myView.on({\n-  'render': function() {\n-    console.log('this collection view childen were rendered');\n-  },\n-  'before:render': function(){\n-    console.log('the collection view children are about to be rendered');\n-  }\n-});\n-\n myView.render();\n ```\n \n+##### Collection `render`\n+\n+Fires when the collection has completely finished rendering. See the\n+[`render` Documentation](./marionette.view.md#view-render) for more information.\n+\n+#### View Destruction Lifecycle","path":"docs/marionette.collectionview.md","position":246,"original_position":246,"commit_id":"907a317c662bbefdb25a1d800760a2c6f896f5aa","original_commit_id":"907a317c662bbefdb25a1d800760a2c6f896f5aa","user":{"login":"ahumphreys87","id":2510520,"avatar_url":"https://avatars.githubusercontent.com/u/2510520?v=3","gravatar_id":"","url":"https://api.github.com/users/ahumphreys87","html_url":"https://github.com/ahumphreys87","followers_url":"https://api.github.com/users/ahumphreys87/followers","following_url":"https://api.github.com/users/ahumphreys87/following{/other_user}","gists_url":"https://api.github.com/users/ahumphreys87/gists{/gist_id}","starred_url":"https://api.github.com/users/ahumphreys87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahumphreys87/subscriptions","organizations_url":"https://api.github.com/users/ahumphreys87/orgs","repos_url":"https://api.github.com/users/ahumphreys87/repos","events_url":"https://api.github.com/users/ahumphreys87/events{/privacy}","received_events_url":"https://api.github.com/users/ahumphreys87/received_events","type":"User","site_admin":false},"body":"drop `View`","created_at":"2016-08-16T21:50:45Z","updated_at":"2016-08-16T21:50:45Z","html_url":"https://github.com/marionettejs/backbone.marionette/pull/3120#discussion_r75027514","pull_request_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120","_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/75027514"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/3120#discussion_r75027514"},"pull_request":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120"}}},"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120","id":81208758,"html_url":"https://github.com/marionettejs/backbone.marionette/pull/3120","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/3120.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/3120.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3120","number":3120,"state":"open","locked":false,"title":"Collection view Events","user":{"login":"scott-w","id":1969937,"avatar_url":"https://avatars.githubusercontent.com/u/1969937?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-w","html_url":"https://github.com/scott-w","followers_url":"https://api.github.com/users/scott-w/followers","following_url":"https://api.github.com/users/scott-w/following{/other_user}","gists_url":"https://api.github.com/users/scott-w/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-w/subscriptions","organizations_url":"https://api.github.com/users/scott-w/orgs","repos_url":"https://api.github.com/users/scott-w/repos","events_url":"https://api.github.com/users/scott-w/events{/privacy}","received_events_url":"https://api.github.com/users/scott-w/received_events","type":"User","site_admin":false},"body":"### Proposed changes\r\n - Rename marionette.events.md to events.md\r\n - Change the CollectionView events to reflect View events structure\r\n\r\nLink to the issue: #3052\r\n","created_at":"2016-08-13T06:29:41Z","updated_at":"2016-08-16T21:50:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8725eed441112921f09ca480195340b85be2408d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120/comments","review_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3120/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/907a317c662bbefdb25a1d800760a2c6f896f5aa","head":{"label":"scott-w:collection-view","ref":"collection-view","sha":"907a317c662bbefdb25a1d800760a2c6f896f5aa","user":{"login":"scott-w","id":1969937,"avatar_url":"https://avatars.githubusercontent.com/u/1969937?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-w","html_url":"https://github.com/scott-w","followers_url":"https://api.github.com/users/scott-w/followers","following_url":"https://api.github.com/users/scott-w/following{/other_user}","gists_url":"https://api.github.com/users/scott-w/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-w/subscriptions","organizations_url":"https://api.github.com/users/scott-w/orgs","repos_url":"https://api.github.com/users/scott-w/repos","events_url":"https://api.github.com/users/scott-w/events{/privacy}","received_events_url":"https://api.github.com/users/scott-w/received_events","type":"User","site_admin":false},"repo":{"id":31324470,"name":"backbone.marionette","full_name":"scott-w/backbone.marionette","owner":{"login":"scott-w","id":1969937,"avatar_url":"https://avatars.githubusercontent.com/u/1969937?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-w","html_url":"https://github.com/scott-w","followers_url":"https://api.github.com/users/scott-w/followers","following_url":"https://api.github.com/users/scott-w/following{/other_user}","gists_url":"https://api.github.com/users/scott-w/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-w/subscriptions","organizations_url":"https://api.github.com/users/scott-w/orgs","repos_url":"https://api.github.com/users/scott-w/repos","events_url":"https://api.github.com/users/scott-w/events{/privacy}","received_events_url":"https://api.github.com/users/scott-w/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scott-w/backbone.marionette","description":"The Backbone Framework","fork":true,"url":"https://api.github.com/repos/scott-w/backbone.marionette","forks_url":"https://api.github.com/repos/scott-w/backbone.marionette/forks","keys_url":"https://api.github.com/repos/scott-w/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scott-w/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scott-w/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/scott-w/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/scott-w/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/scott-w/backbone.marionette/events","assignees_url":"https://api.github.com/repos/scott-w/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/scott-w/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/scott-w/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scott-w/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/scott-w/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/scott-w/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/scott-w/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/scott-w/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/scott-w/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/scott-w/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/scott-w/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/scott-w/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/scott-w/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/scott-w/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scott-w/backbone.marionette/merges","archive_url":"https://api.github.com/repos/scott-w/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scott-w/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/scott-w/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/scott-w/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/scott-w/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/scott-w/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scott-w/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/scott-w/backbone.marionette/releases{/id}","deployments_url":"https://api.github.com/repos/scott-w/backbone.marionette/deployments","created_at":"2015-02-25T16:52:48Z","updated_at":"2016-05-13T19:57:44Z","pushed_at":"2016-08-15T17:52:55Z","git_url":"git://github.com/scott-w/backbone.marionette.git","ssh_url":"git@github.com:scott-w/backbone.marionette.git","clone_url":"https://github.com/scott-w/backbone.marionette.git","svn_url":"https://github.com/scott-w/backbone.marionette","homepage":"http://marionettejs.com","size":10631,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marionettejs:next","ref":"next","sha":"53310d26c3b221e1505e4d0ec95a9a5e8333e37d","user":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"repo":{"id":2965621,"name":"backbone.marionette","full_name":"marionettejs/backbone.marionette","owner":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marionettejs/backbone.marionette","description":"The Backbone Framework","fork":false,"url":"https://api.github.com/repos/marionettejs/backbone.marionette","forks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/forks","keys_url":"https://api.github.com/repos/marionettejs/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marionettejs/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marionettejs/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/events","assignees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/marionettejs/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/marionettejs/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/marionettejs/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marionettejs/backbone.marionette/merges","archive_url":"https://api.github.com/repos/marionettejs/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marionettejs/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/marionettejs/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/marionettejs/backbone.marionette/releases{/id}","deployments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/deployments","created_at":"2011-12-12T16:36:09Z","updated_at":"2016-08-16T21:15:00Z","pushed_at":"2016-08-16T11:06:33Z","git_url":"git://github.com/marionettejs/backbone.marionette.git","ssh_url":"git@github.com:marionettejs/backbone.marionette.git","clone_url":"https://github.com/marionettejs/backbone.marionette.git","svn_url":"https://github.com/marionettejs/backbone.marionette","homepage":"http://marionettejs.com","size":18253,"stargazers_count":6949,"watchers_count":6949,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1359,"mirror_url":null,"open_issues_count":109,"forks":1359,"open_issues":109,"watchers":6949,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/3120"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3120"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3120/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120/comments"},"review_comment":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3120/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/907a317c662bbefdb25a1d800760a2c6f896f5aa"}}}}
{"actor":{"display_login":"ahumphreys87"}}