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

  • Home
  • SEARCH
  • 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 7519071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:50:34+00:00 2026-05-30T01:50:34+00:00

Take a HTML tabbar as example. Usually you have a ul and a list

  • 0

Take a HTML tabbar as example. Usually you have a ul and a list of div’s. All the Backbone examples that I have found, link the View with only one node by the ‘el’, ‘tagName’, etc…

HTML TabBar:

<div class=".tabbar">
    <ul class=".tabbar-header">
        <li><a href="#tab-cars">Cars</a></li>
        <li><a href="#tab-houses">Houses</a></li>
    </ul>

    <div id="tab-cars" class=".tabbar-item">...</div>
    <div id="tab-houses" class=".tabbar-item">...</div>
</div>

Backbone Code:

window.TabBarView = Backbone.View.extend({

    el: ???,

    tabs: [],   

    render:function (eventName) {

        // Render all tabs in this.tabs

        _.each(this.tabs, function (item, position) {
            // Render each tab with item.render()
        }, this);

        return this;
    }
});

window.TabBarItemView = Backbone.View.extend({

    el: ???,

    initialize:function () {
        this.model.bind("change", this.render, this);
        this.model.bind("destroy", this.close, this);
    },

    render:function (eventName) {

        // Render the tab header and tab content

        return this;
    }

});

I wish to add several TabBarItemView’s to the TabBarView and each one creates itself the li node inside the ul.tabbar-header and the div.tabbar-item as content.

  • 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-30T01:50:35+00:00Added an answer on May 30, 2026 at 1:50 am

    I’ve written an article that addresses this issue: http://lostechies.com/derickbailey/2011/10/11/backbone-js-getting-the-model-for-a-clicked-element/

    It will show you how you can either use a single view to do what you want, or a parent/child setup with a collection view and item view like you’re showing in your sample code

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

Sidebar

Related Questions

Take a look at this example: http://www.extjs.com/deploy/dev/examples/multiselect/multiselect-demo.html On it, there are components rendered against
Take a very simple case as an example, say I have this URL: http://www.example.com/65167.html
I am doing an application where I am using the following link http://iosdevelopertips.com/cocoa/date-formatters-examples-take-3.html to
All the examples of jQuery.append() seem to take an html string and append it
I'm interested in a parser that could take a malformed HTML page, and turn
Take a look at the example here: http://www.brianhare.com/physics/so.html Take a look at console.log where
Lets take a static html page as a scenario, lets say you have a
I'm having an application that need to take html and get some tags inside
I'm looking for some sort of tool that can take an html document and
I have a stream loaded with HTML that I got from an export. I

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.