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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:23:27+00:00 2026-05-27T18:23:27+00:00

I am creating my application using backbone.js As seen below I have a layoutView

  • 0

I am creating my application using backbone.js

As seen below I have a layoutView which I use to render the layout and also a mini profile within the layout.

The issue I have is with timing. I need to have the ‘render’ method complete first before triggering ‘renderProfile’ method. How can I do that?

Onethingaday.Views.Home ||= {}

class Onethingaday.Views.Home.LayoutView extends Backbone.View
  template: JST["backbone/templates/home/layout"]

  initialize: ->
    @options.user.bind('change',@render,@renderProfile, @)

  renderProfile: ->
    view = new Onethingaday.Views.Shared.MiniProfileView
      user: @options.user

    @$('.profile').html view.render().el

  render: ->
    $(@el).html(@template())
    @
  • 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-27T18:23:28+00:00Added an answer on May 27, 2026 at 6:23 pm

    Your situation is why I wrote LayoutManager for Backbone, http://github.com/tbranyen/backbone.layoutmanager.

    What you should be doing is separating your sub views from your main (layout) view.

    So in your route callback you’d have something like this:

    // Initialize a Layout View
    var profile = new Onethingaday.Views.Home.LayoutView();
    // Initialize a MiniProfile View
    var miniProfile = new Onethingaday.Views.Shared.MiniProfileView({
      model: user
    });
    
    // This appears synchronous in your code, so this should work fine
    $(profile.render().el).find(".profile").html(miniProfile.render());
    

    I would implore you to investigate my library, as I think the declarative manner in which sub views are associated to layouts is really quite elegant.

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

Sidebar

Related Questions

I am creating an application using WPF which is using Prism framework. I have
I am creating an application using Grails Framework for which I plan to use
I am currently creating an MVC3 application using Ninject. I have two controllers which
I am creating an application using the Twitter API. I have retrieved the profile
I have recently started creating an iPhone application using Appcelerator's Titanium. Since the application
I have developed an application using Eclipse IDE. After creating the application I exported
I am creating a chat application using JApplet . I have a TextArea where
I'm currently creating an application using the MVC3 framework. I understand how to use
I am creating an application using the MVVM pattern and somewhere I have a
I am creating a web application using Netbeans and servlets. I have used some

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.