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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:19:27+00:00 2026-06-18T06:19:27+00:00

My events are not loading automatically. When I added delegateEvents() at the end of

  • 0

My events are not loading automatically. When I added delegateEvents() at the end of the render() method, it worked for a while. I do not want to use delegateEvents, but now, even with delegateEvents the events are not loading.

I reckon the DOM is not known at the time, so the events aren’t bound, but how do I check (debug) that?

View:

class EditGroup extends BaseView
    initialize: ->
        @render()

    render: ->
        html = _.template tpl, @model.toJSON()
        @$el.html html

        for own key, options of FormConfig[@model.type]             
            options.key = key
            options.value = @model.get key
            input = new Input options
            input.on 'valuechanged', (key, value) => @model.set key, value

            @$('section.'+key).html input.$el

        @delegateEvents() # doesn't work

        @

DOM:

h2 Edit Group

section.title
section.type
section.members

button.save.btn.btn-primary(onclick="return false") Save changes

In the sections type and member there are typeaheads and selects rendered (Backbone views). One works without delegateEvents and the other works with. The events in the parent view (shown above) don’t work at all. Removing the for-loop doesn’t make any difference.

  • 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-18T06:19:29+00:00Added an answer on June 18, 2026 at 6:19 am

    Ok, I solved it, but I don’t understand the workings.

    I’m using a ‘view manager’, which registers all views and shows (read: attaches the html to the DOM) the parent view. The view manager’s show function is triggered when a new route is fired, but the route was fired double, once as “route:edit” and once as “route”. I catch them with router.on “all”, (eventName) -> etc.. I reckon the events are bound to the html, but the html is overridden by the second router event without the bindings and attached to the DOM. Question remains why the route is fired twice.

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

Sidebar

Related Questions

What if I want not only to add events for all future added, but
I have two click-events, that are nearly similar, but not quite. I am wondering
I'm using cloudflare. My site is working good but not loading any images, css
I'm using h:selectOneMenu and I want to get not the ID value, but the
Trying to figure out how to type (via events not set the value) on
I have appended content (using ajax) to my document and my events are not
I am not looking to create new events. I need to create a canvas
The events scrolltoVerticalOffset or the scrolltoHorizontalOffset do not change the values of the scrollviewer.
I have an Events table with a not-null date field. Based on a pivot
Kinect sensor raises many events per second and if you are not very fast

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.