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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:09:08+00:00 2026-06-18T08:09:08+00:00

My rendered method is being called before _initializeLayout: var _initializeLayout = function() { console.log(‘initializeLayout…’);

  • 0

My rendered method is being called before _initializeLayout:

var _initializeLayout = function() {

    console.log('initializeLayout...');

    Controller.layout = new Layout();

        Controller.layout.on("show", function() {

        vent.trigger("layout:rendered");

    });

    vent.trigger('app:show', Controller.layout);

};

I use the layout in the on rendered method:

// controller attach a sub view/ search View
vent.on("layout:rendered", function() {
    console.log('layout:rendered =>StartController');

    // render views for the existing HTML in the template, and attach it to the layout (i.e. don't double render)
    var inspectorStartView = new InspectorStartView();
    Controller.layout.inspector.attachView(inspectorStartView);

    var playerStartView = new PlayerStartView();
    Controller.layout.player.attachView(playerStartView);
});

When I try it, my on rendered callback is called before _initializeLayout(). I have it calling _initializeLayout in the router/controller method:

Controller.go_inspector_control_center = function(term) {
        _initializeLayout();
        //vent.trigger("search:term", term);
    };

I just ran it again and found that an event was being triggered from a different controller’s _initializeLayout() method:

   // private
var _initializeLayout = function() {
    console.log('initialize Start Layout...');
    Controller.layout = new Layout();
    Controller.layout.on("show", function() {
        **vent.trigger("layout:rendered"); // <--**
    });
    vent.trigger('app:show', Controller.layout);
};

It appears that the events need to have unique names. I’ll try that. If anyone knows please chime in.

Andrew

  • 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-18T08:09:08+00:00Added an answer on June 18, 2026 at 8:09 am

    You just can’t take us Java guys anywhere. The answer (in Javascript) is that I do need to name my events uniquely. Makes sense when you think about it.

    Although most event systems I’ve worked with X11/Java you don’t name your event you use what they give you.

    Here is a stackoverflow question on event naming.

    I hope my public learning is helping others. 😉

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

Sidebar

Related Questions

I have a controller class with a RequestMapping method. This method is not being
I have a function calling a controller method in MVC3. $.getJSON('@Url.Action(LoadCitiesByProvince, Property)', { id:
The fonts are being rendered crisply to a fault, such that the edges are
Inside Controller I need to get a rendered string and do some actions with
I have the google+ button being rendered on my site as follows: In the
I am using a form_for method in a form that gets rendered by the
When a view has been rendered in memory and before it is sent as
I have this code in my create.js.erb file: pollingAJAX(); function pollingAJAX() { $.ajax({ method:
I have a Rails controller where I accidentally defined the 'edit' method inside the
Implementing custom DataAnnotationsModelMetadataProvider in ASP.NET MVC2. Assuming the object that is being rendered looks

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.