Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, giving you a specific answer is difficult: the code you've pasted is a bit hard to follow, and seems like it might be missing bits (eg. what's a <code>groupDetailsModel</code>? Does it have any logic that affects it's view?). That's ok though, because I think what you need here is more debugging help than a specific answer.</p> <p>If I understand you correctly, your problem is that <code>groupDetails.render()</code> is being invoked extra times, and you're not sure why or what is invoking it: is that correct? If so, your trusty debugger can answer this in a matter of seconds.</p> <p>NOTE: Everything I'm about to say applies to Chrome (with the built-in developer tools up) or Firefox (with the Firebug extension up) for sure. It probably applies to other browsers with their tools too, I just can't say for sure since I don't use them.</p> <p><strong>Approach #1: Debugger</strong></p> <p>With your debugger up, add a <code>debugger;</code> line as the first thing inside your <code>GroupDetails.prototype.render</code> method. This will make your browser pause on that line whenever it hits it. While its paused you can check the "call stack" on the right-hand side, and that will show you <em>exactly</em> what bit of your code just called that render. You can also use the debugger to inspect the values of the different variables in your environment to try and understand <em>why</em> your code is calling <code>render</code>.</p> <p><strong>Approach #2: Console.trace</strong></p> <p>If you're not a fan of using the debugger, there's another tool that's also perfect for answering this sort of question. Simply add <code>console.trace()</code> as the first line in your render method, then run your code as normal. This time your browser will log (to the "console") a stack trace generated from that point in the code. This stack trace is similar to the call stack that you can see when you use <code>debugger</code>, and thus it will tell you exactly what code invoked the <code>render</code> each time.</p> <p>Hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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