0

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?

Stefan Kostic
  • 262
  • 4
  • 14
  • Could you show us your template? – Henry Vonfire Nov 30 '15 at 08:57
  • Here is the [link to jsBin](http://jsbin.com/tazuwawema/edit?html,css,js,output) , this is of course not the working example, but I pasted the code there as it is quite big. In fact, I have component that extends ember-table, so that I have filtering and paging, I pasted the code for everything. As some things might not be easy to understand, please ask for clarification. – Stefan Kostic Nov 30 '15 at 09:16
  • I would recommend you to test just one table to see if it works fine. If it does not then there is a problem in the way you have extended `ember-table`. Also check if there is any issue related with the version of `ember-table` you are using. – Henry Vonfire Nov 30 '15 at 10:33
  • Single table is working perfect, i am already using it in many different pages. However problem occurs as soon as I put 2 or more tables on one page/template. It seems like both tables are using some shared variables. I guess components in Ember are not singletons? If they are, that would surely be a problem? – Stefan Kostic Nov 30 '15 at 10:53

2 Answers2

0

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.

Stefan Kostic
  • 262
  • 4
  • 14
0

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.

Bek
  • 3,157
  • 1
  • 17
  • 28