I have one Repeater nested in another one. The second level one is initiated from "onSetupItem" of the first. The second one in it's "onSetupItem" have index of 0 all the time. Any tips ?
@Martin, I've got a version that works with the latest nightly build. There were two things that resulted in it not working:
1) Enyo now checks to ensure a kind is not being overridden by kind name alone, so when it determined that a kind with the name already existed, it put a halt to the creation of the modified kind 2) With the latest code on the master branch (and in the nightly build), there is delegation code inside of the enyo.OwnerProxy kind. As such, the event wasn't being delegated to the proper Repeater. That's fixed in the code I put together based on Ryan's code.
There's a philosophical issue with this, though... what should index be for a sub-repeater sending onSetupItem? The fix makes it more obvious, but it means your onSetupItem handler for the inner repeater doesn't know the top-level index in which it lives.
In general, I'd want to solve this by not having nested repeaters in one kind but instead factoring out the inner controls to a new kind which would then be repeated.
Comments
edit ... tried it out in jsfiddle and saw the same behavior ... investigating ...
Broken
Fixed
Bug filed
Fixed
Thanks a lot!
FYI - this "Fixed" version seems to work fine with Enyo 2.2.0 !
But with latest nightly build version it again does not work.
1) Enyo now checks to ensure a kind is not being overridden by kind name alone, so when it determined that a kind with the name already existed, it put a halt to the creation of the modified kind
2) With the latest code on the master branch (and in the nightly build), there is delegation code inside of the enyo.OwnerProxy kind. As such, the event wasn't being delegated to the proper Repeater. That's fixed in the code I put together based on Ryan's code.
You can see my version at http://jsfiddle.net/arthurthornton/DPmNZ/ for the fixed code that should work.
Looking forward to Enyo 2.3 update.
In general, I'd want to solve this by not having nested repeaters in one kind but instead factoring out the inner controls to a new kind which would then be repeated.