Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7773171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:04:13+00:00 2026-06-01T17:04:13+00:00

A quick question regarding Events in Backbone – is there any way to define

  • 0

A quick question regarding Events in Backbone – is there any way to define a set of global events, which can be re-used in different views?

For instance – say I have several Views which are rendered on the page. Each View has a button that will expand a menu. There are also several other generic elements and events. Without putting this event logic into each View, is there a way that each of these Views could inherit, or pull these events from a global events definition? It would certainly save time and be a lot cleaner solution by defining these generic events in one place.

I’ve seen terms such as Event Aggregator and Factory patterns thrown around – but not sure on the best approach (or if they will achieve what I’m after).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:04:15+00:00Added an answer on June 1, 2026 at 5:04 pm

    You’re basically describing an event aggregator or dispatcher, yes. I’ve got a couple of articles on building and using them with Backbone:

    http://lostechies.com/derickbailey/2011/07/19/references-routing-and-the-event-aggregator-coordinating-views-in-backbone-js/

    http://lostechies.com/derickbailey/2012/04/03/revisiting-the-backbone-event-aggregator-lessons-learned/

    And there are plenty more articles around the web for doing the same with Backbone and other pub/sub libraries.

    It’s quite simple to do in Backbone:

    
    vent = _.extend({}, Backbone.Events);
    

    and now you have a vent object that can be used as an event aggregator throughout all of your application’s views and other objects.

    
    vent.on("some:event", function(){
      console.log("some event was fired");
    });
    
    vent.trigger("some:event");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question regarding delegateEvents in a View - can we specify multiple event bindings
I have a quick question regarding the proper way to access Javascript class member
quick question regarding Array's in xcode. I have ht efollowing code, which is supposed
Quick question here: is there any obvious benefit to use asynchronous communication with the
Quick question regarding the Compact Framework DataGrid. How can I scroll a particular row
Just a quick question regarding the split function How can I split my string
A quick question regarding WPF: How can I select child elements within a Canvas/Grid?
Quick question regarding memory management in C++ If I do the following operation: pointer
I have a quick question regarding debug and release in VS 2008. I have
I am somewhat new to LINQ and have a quick question regarding deleting. Say,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.