Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4831

Find element in DOM

$
0
0

@Nitram wrote:

Hi,

I want to get name and width in px (element) of differents elements when they are created. I use Ember.run and “afterRender” for this, but I would like to use something else of jQuery

This is my code :

//controllers/build.js
    Ember.run.schedule('afterRender', this, () => {
          let columnsModelAttribution = Ember.A([]);
          let modelAttributionDiv = Ember.$(".containers-parent .report-container");

          if(modelAttributionDiv.length > 0){
            modelAttributionDiv.each((index) => {
              let name = 'example';

              columnsModelAttribution.pushObject({name: name, 'width': Ember.$(modelAttributionDiv[index]).outerWidth()});
            });
          }
        });
      }).on('init'),

I have too access to the object who help me to create element. Do you have any ideas ?

Thanks a lot

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4831

Trending Articles