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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:47:30+00:00 2026-06-17T02:47:30+00:00

Hey all I am pretty new to Backbone though I have put several days

  • 0

Hey all I am pretty new to Backbone though I have put several days into trying to get familiar with this framework, and it seems everytime I start feeling comfortable I run across a new problem.

I am wondering how to reference a view that is rendered from within my main appview. I know this is a really simple issue but I just can’t seem to figure it out.

So for instance I have a simple view

    var SubView = Backbone.View.extend({
    //something here including render function
});

Then I render that view from within the main app view

var myApp = Backbone.View.extend({
    render: function{
        var mysubView = new SubView();
        mysubView.render();
    },
    editSomething: function{
        mysubView.remove();
    }
});

When I try and reference that view from a function (editSomething:) in the main app view, I get a reference error.

What I am trying to achieve is that I have two views that include forms. I want to swtich between the two forms as an edit function is called and when an add function is called. But I can’t seem to access the views that have already been rendered.

I don’t want to initialize and render a new view before removing the existing view because from what I understand, I will start to get a bunch of views floating in memory.

  • 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-17T02:47:31+00:00Added an answer on June 17, 2026 at 2:47 am

    Reference it using this:

    var myApp = Backbone.View.extend({
        render: function{
            this.subView = new SubView();
            this.subView.render();
        },
        editSomething: function{
            this.subView.remove();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all I'm trying to get a feel for angular and have ran into
hey the title pretty much says it all. i have been trying different methods
Hey I'm pretty new to XSLT's and trying to get my head around using
Hey all, I'm pretty new to python, so bear with me. I want to
Hey all. Im trying to sort out how to get MATLAB running as best
Hey everyone! Im pretty new to Android and I have a webView under 2
Hey guys I've been trying all day to get an ant file to automatically
Hey all i am trying my best to get the follow query: SELECT Client,
Hey all i have this javascript within my VB code that checks for if
Hey all. I've been been trying to figure this out for a while now.

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.