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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:07:19+00:00 2026-06-08T03:07:19+00:00

I got several different views which are mostly built up like (layout-component, layout, main

  • 0

I got several different views which are mostly built up like (layout-component, layout, main view).

When I now switch between different views the whole page has to get rerendered.

Wouldn’t it be better to cache at least the layout view in “window” and reload them?

Something like a singleton pattern for backbone views?

How do I do this?
Is a simple:

window.MainLayoutView || window.MainLayoutView = new MainLayoutView({ el: 'div.main' });

enough?

Is there anything else I have to think about?

  • 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-08T03:07:20+00:00Added an answer on June 8, 2026 at 3:07 am

    Yes, there is more to worry about. If you do something like this:

    window.MainLayoutView.render();
    $(x).html(window.MainLayout.el);
    // And later...
    $(x).html(someOtherView.el);
    // And later still...
    $(x).html(window.MainLayout.el);
    

    you’ll find that all your events inside window.MainLayout are gone. If you want to cache the instantiated view and swap it in and out, you’re going to have to arrange delegateEvents calls to rebind all the events all the way down the view hierarchy.

    Compare the behavior of these two examples and you’ll see the problem:

    • http://jsfiddle.net/ambiguous/Mrt3C/ (no delegateEvents calls).
    • http://jsfiddle.net/ambiguous/Mrt3C/1/ (with delegateEvents calls).

    Generally you don’t bother trying to cache views, just remove them and recreate them as needed.

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

Sidebar

Related Questions

I've got a WrapPanel which will contain several different custom UserControls . Depending on
We've got an application which will be using RabbitMQ and have several different queues
In my ASP.net MVC application, I've got several views that I'd like to set
I am trying to retrieve like several different values from a table. I got
I've got several div id's, each containing a different client. I want to be
I've got several megabytes of data like this: 11 2 1 4 3 1
We've got several Flex projects, one of which has just been refactored. I'm wondering
so in my application I've got several different customers being serviced. Each customer has
I've got several reports and they have been built with various formatting. Nothing huge
I've got several elements on a HTML page which have the same class -

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.