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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:16:05+00:00 2026-06-06T17:16:05+00:00

I found a lot of questions about how to initialize jQuery plugins with dynamic

  • 0

I found a lot of questions about how to initialize jQuery plugins with dynamic data etc and usually the answer is that you should use the didInsertElement hook. My problem is that when using ember-data, initially the view is inserted empty and the template vars are filled afterwards through the bindings. Thus in didInsertElement the elements I need are not there.

I found a solution that works for me but I think there must be a better solution.

In addition to the didInsertElement method I also observe the attributes in the controller and call my code from there, too, wrapped in a Ember.run.next so the child view is rendered before.

Is there a better solution to react to updated child views?

  • 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-06T17:16:07+00:00Added an answer on June 6, 2026 at 5:16 pm

    It depends a bit on the size of your application, and the number of elements your view is rendering.

    Edit: You might successfully observer the isLoaded property of the RecordArray. Some details here: https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/record_arrays/adapter_populated_record_array.js#L21

    One option that I have used for views that have a single object as their content is something like:

    MyApp.CustomView = Ember.View.extend({
        content: null,
    
        contentObserver: function() {
            this.rerender();
        }.observes('content')
    }
    

    If your view contents is a list, it makes little sense to re render the view for each item in the list, though.

    However, I think this approach is fairly similar to what you are already doing, though.

    Another approach is to implement your own adapter with Ember Data. This way, you can tell the rest of your application that it’s finished loading your data. Something like:

    MyApp.Adapter = DS.Adapter.create({
        //Finding all object of a certain type. Fetching from the server
        findAll: function(store, type, ids) {
            var url = type.url;
            jQuery.getJSON(url, function(data) {
                store.loadMany(type, data);
            });
    
            //Perform some custom logic here... 
        }
    }
    

    This should work, but its not as generic as it should/could be though.

    Also, you might want to take a look at this commit, which allows for registering a one-time event.

    https://github.com/emberjs/ember.js/commit/1809e65012b93c0a530bfcb95eec22d972069745#L0R19

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

Sidebar

Related Questions

i found a lot of questions about resizing images in .NET and whatnot, but
I've already found a lot of questions about manipulating the highlight of items to
There are a lot of questions about big O notation, but I didn't found
I've looked around and found a lot of questions about this, but none of
I've already found a lot of things and questions about UnsatisfiedLinkError in combination with
I found a lot of links on metaclasses, and most of them mention that
I have found a lot of topics about stress-testing web application. My goals are
I've found a lot of solutions to about how its possible to copy a
There are a lot of questions here about Greasemonkey, but I didn't see anything
I have found a lot of information about adding form helper methods (see one

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.