ExtJs 4.1.0 - XTemplate and nestled tpl for loops does not set parent values properly

Ext version tested:

ExtJS 4.1.0

Browser versions tested against:

Chrome 19

IE9

Firefox 13.0.1 (firebug 1.9.2 installed)

Description:

XTemplate does not set parent values properly, when there's a nestled loop inside the loop that uses the parent value.

The example below has "tpl for" loops in three levels: level1, level2 and level3. On level2, parent.id only has a value the first time the level2 loop iterates, and in each following iteration on level2 parent.id is not set. When level1 iterates a second time, the first iteration in level2 again has a value, only to be unset the next time level2 iterates. If the "tpl for" loop for level3 is removed, however, level2 works as expected. See the areas marked yellow in the screenshot below, to see how parent.id is sometimes set, and sometimes not, when level2 loops.

Steps to reproduce the problem:

Save the code below in an html file, then load the html file in a browser.