Note that there are some explanatory texts on larger screens.

plurals
  1. POUncaught: You can't call rerender on a view being destroyed
    primarykey
    data
    text
    <p>When I navigate around my app, I often get this error which further destroy all navigation in my app, and I have to reload the whole page:</p> <pre><code>Uncaught You can't call rerender on a view being destroyed </code></pre> <p>I, and a couple of the boys on the Ember IRC channel figured out what causes the problem.</p> <p>It's the group helper from <a href="https://github.com/emberjs/group-helper" rel="nofollow">https://github.com/emberjs/group-helper</a> that I use. The whole app is set up to use that, and lots of stuff breaks if I remove it because then a lot of metamorph tags starts to get created yet again.</p> <p>Any idea how to modify the helper so that the error goes away?</p> <pre><code>var get = Ember.get, set = Ember.set, EmberHandlebars = Ember.Handlebars; EmberHandlebars.registerHelper('group', function(options) { var data = options.data, fn = options.fn, view = data.view, childView; childView = view.createChildView(Ember._MetamorphView, { context: get(view, 'context'), template: function(context, options) { options.data.insideGroup = true; return fn(context, options); } }); view.appendChild(childView); }); </code></pre> <p><strong>Updated: Stuff below is outdated and only there because it was in the original post</strong></p> <p>In my app, i have these three subclasses, which I base all of my views, array controllers and routes on.</p> <p><strong>View:</strong></p> <pre><code>PageView = Ember.View.extend({ title: '', identifier: '', classNames: ['page'], willDestroyElement: function () { var elm_classes = this.$().attr('class') + ' out', elm_height = this.$().height(), temporary_container = $('&lt;div class="'+elm_classes+'"&gt;'); this.$().children().appendTo(temporary_container); temporary_container.insertAfter(this.$()); window.setTimeout(function() { temporary_container.remove(); }, animationKillDuration); }, didInsertElement: function() { $(document).trigger('royalbeer-page-rendered'); } }); </code></pre> <p><strong>Array controller</strong></p> <pre><code>RoyalArrayController = Ember.ArrayController.extend({ goto: function(route, slug) { if (!slug) this.transitionToRoute(route); else this.transitionToRoute(route, slug); } }); </code></pre> <p><strong>Route:</strong></p> <pre><code>RoyalRoute = Ember.Route.extend({ setupController: function(controller, model) { var modelName = this.routeName.substr(0, 1).toUpperCase() + this.routeName.substr(1), slug = model; if (model.hasOwnProperty('slug')) slug = model.slug; controller.set('model', App[modelName].find({'slug': slug})); }, serialize: function(slug, params) { var name, object; object = {}; name = params[0]; object[name] = slug; return object; } }); </code></pre> <p>I use the goto function in the array controller to bind elements in my app for navigation with <code>{{action goto 'routename' slug}}</code>, and my serializer and setupController on my route is set up to be able to handle that, which works perfectly until the error occurs.</p> <p>And I can only guess that it is because of those that the thing breaks.</p> <p>Any ideas as to what is going on and how to fix it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload