简体   繁体   中英

multiple tables on one template

When I render two or more tables on same template I get several deprecations like this one

DEPRECATION: You modified (mut bodyContent) twice in a single render. This was unreliable in Ember 1.x and will be removed in Ember 2.0 [deprecation id: ember-views.render-double-modify]

Furthermore, tables are loading very slow, they are buggy and unreliable - most of the time tables are populated with data, but it even happens that they stay empty - like there is a race condition problem.

Does anyone have an idea what could be a problem?

This probably is not a best practice solution, but it does the job. I noticed that when components are rendered at the same time, it takes much more time for rendering. The trick then is to delay rendering of second component, 100ms was enough for me, and after that components are rendered instantly without noticing any lag. I also experienced much longer rendering times in Mozilla Firefox, than in Chrome.

you need need probably wrap your code with following:

Ember.run.scheduleOnce('afterRender', this, function(){
// error causing code
})

it insures that it is invoked once after render.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM