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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:04:51+00:00 2026-05-27T04:04:51+00:00

I am creating an app in Backbone.js which has a parent and multiple child

  • 0

I am creating an app in Backbone.js which has a parent and multiple child views. The child views contain links which they listen to and perform a function.

The parent stores a list of all of the children views. In the render function, after it is done computing its own html, it does the following:


$(this.el).html(html);
for (var i = 0; i < this.views.length; i++){
    $('.children', this.el).append(this.views[i].render().el);
}

ANSWER: The problem was that I was creating the link during the render. I.e. on the first render (which was called from the init) the event successfully binded to the link. However, since all following calls of render recreate the whole element, the new link did not have the handler bound to it. This was solved via @Tom Tu solution of adding this.delegateEvents() to the render

  • 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-05-27T04:04:52+00:00Added an answer on May 27, 2026 at 4:04 am

    You are probably using jquery remove function somewhere to remove the subviews from the view – it automatically removes all the events bound to the element (this.el) – set in the events object. You can either use this.delegateEvents() method in render of the subviews after you render template to rebind the event delegates set in events object or use jquery detach method instead to remove elements from DOM without removing event bindings (link). The delegateEvents method is quite costly and thus i’d recommend the detach method for removing elements that you want to reuse if you are rendering long lists of subviews – irrelevant if it’s just a couple of views.

    Other possibility is that you’ve set the events object wrong – hard to tell from the amount of code provided, but i bet on the first one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating an app which has the ability for the user to pin a
We are creating an app that uses modules which are dynamically loaded into the
I am creating an app that is having a UIWebView which contains an advert.
I am creating an app which will have a question in a UILabel and
I'm creating app which uses very large amount of memory. When I finish computation
Im creating an app in which i do a task when i receive a
I am creating an app, in which I have two small imageview (using have
I'm in the process of creating a Backbone.js app using Require.js. Each view file
i am creating app which would download and save files, than user could use
I'm creating app for image scan with WIA. But my images has a lot

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.