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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:06:26+00:00 2026-06-02T04:06:26+00:00

I’m trying to learn Backbone from someone else’s Backbone app in combination with the

  • 0

I’m trying to learn Backbone from someone else’s Backbone app in combination with the documentation. There are two things I don’t understand about it that I can’t figure out from the documentation. Hope someone might be able to explain…

Gist of the app
It’s an app where you can drag and drop company names into boxes.

The app has a Company View, a Company Model and a Companies Collection.

It also has a Bucket View, a Bucket Model, and Buckets Collection

It also has a general App View that’s not associated with any model.

Problems…

First- Is it weird that a view would never be rendered?

The App View is instantiated like this

window.App = new AppView();

and it gets different things going in the app (populating the buckets with company names etc and setting up some events). However, the App View is never rendered. The Bucket View and the Company View, on the other hand, are both rendered at different points in the code. For example,

  var view = new BucketView({model: bucket});
  this.$("#bucket-list").append(view.render().el);

But never that App View. This App View also has no render function. So is it weird that it has a View that’s never rendered? Should its code be somewhere else?

Second Considering that App view is never rendered, is there any reason why they would have to change the default setting of el to the name of the main container div in the layout? For example, in the App view, they do this…

el: $("#mainapp"),

However, if this view’s never rendered, is there any reason to change the default setting of el?

  • 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-02T04:06:27+00:00Added an answer on June 2, 2026 at 4:06 am

    When you create a Backbone.View instance normally, it will immediately generat an el on the view for you. This is used as the placeholder for all of the HTML that the view will manage, and you generally populate the view’s el with your HTML in the render method, as you’ve already noted.

    In some cases, though, you don’t want to render a completely new set of HTML elements. Instead, you’ll want to manage some existing HTML that’s already part of the DOM. In this case, you can easily attach a backbone view to the existing DOM element by specifying the el in the constructor, as you’ve shown with the el: $("#mainapp") line.

    When a Backbone view sees that it already has an el, it does not generate it’s own. Instead, it uses what it was handed.

    So, to directly answer your two questions:

    1) First- Is it weird that a view would never be rendered?

    No, because …

    2) if this view’s never rendered, is there any reason to change the default setting of el?

    The question is slightly off in a manner that that can’t be directly answered. In reality, the view is never rendered because they are setting the el in the call to the constructor.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from

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.