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 8825801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:58:05+00:00 2026-06-14T06:58:05+00:00

I am using Backbone and I have a view with events defined: …. events:

  • 0

I am using Backbone and I have a view with events defined:

    ....
    events: {
        'click .search-button': 'setModelTerm',
        'change .source-select': 'setModelSourceId',
        'change .source-select': 'activateSource'
    },
    ....

I would like to trigger two methods when the event change .source-select fires. The problem is that the last entry in the event object overrides the preceding entry.
How can I trigger two methods in one event?
(I am trying to prevent writing another method that calls those two methods)

  • 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-14T06:58:06+00:00Added an answer on June 14, 2026 at 6:58 am

    You can pass a wrapper function in your hash of events to call your two methods.

    From http://backbonejs.org/#View-delegateEvents

    Events are written in the format {"event selector": "callback"}. The
    callback may be either the name of a method on the view, or a direct
    function body.

    Try

    events: {
        'click .search-button': 'setModelTerm',
        'change .source-select': function(e) {
            this.setModelSourceId(e);
            this.activateSource(e);
        }
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a View (created using Backbone.View.extend) and a JSON object, I actually get
I am using backbone.js here is my scenario Lets say I have a view
Using a Backbone.js View, say I want to include the following events: events: {
I'm using Backbone.js have a segmented control-type UI element for each model's view. They
I'm using Backbone and have the following view: class GT.RunManager.Views.ViolationMarker extends Backbone.View className: 'violation-marker'
I have been using Backbone.js to act as a middleman between Wordpress (using the
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
I have a models.DateTimeField() field in my django model. I am using backbone to
I have a Rails 3.2.3 app with Backbone.js and I'm using pushState on my
I'm using Backbone.Marionette and need to render a view of employees and their respective

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.