title: Triggering custom events in backbone.js
body: <p>I am trying to better structure my events in backbone. Currently I have one view communicating with another by triggering events within a function, and listening for events in another function, like:</p>
  
  <pre><code>//childView
  triggerFilterChange: function(e){
    Backbone.trigger('filterChange',activeFilters);
  }
  
  //parentView
  
  initialize: function(){
    Backbone.on('filterChange', this.onFilterChange, this);
  },
  
  onFilterChange:function(filters){
    //DO STUFF
  }
  </code></pre>
  
  <p>This works, however, I would like to make it more clear in my child view what events should be expected, rather than just triggering something from a random function somewhere buried within the view. For example, all of my click events for the child view are clearly delineated at the top of the page:</p>
  
  <pre><code>define([
    'jquery',
    'underscore',
    'backbone',
  ], function($, _, Backbone){
  
    var ProductsFiltersView = Backbone.View.extend({
  
      events : {
            "click .filter-options-container" : "filterOptionContainerClick",
            "click .filter-option" : "filterOptionClick",
      },
  </code></pre>
  
  <p>So my question is, is there a way to put custom events into this events object? Or some structure similar to this, so you know at the top of the view what events might be triggered? Like:</p>
  
  <pre><code>events : {
                "click .filter-options-container" : "filterOptionContainerClick",
                "click .filter-option" : "filterOptionClick",
                "filterChange" : "doFilterChange"
          },
  
  doFilterChange: function(){
    Backbone.trigger('parentFilterChange',activeFilters);
  }
  </code></pre>