Thanks Simon. I think my new question is now regarding this line:
An added event with no namespace, which bubbles but is not cancelable and has no default action, must be fired on the repetition template using the RepetitionEvent interface, with the repetition block's DOM node as the context information in the element attribute.
If my template has an id of "items" then I'm expecting to be able to do the following in order to get feedback when a new repetition block has been added:
- Code: Select all
document.getElementById('items').addEventListener('added', asdf(), false);
function asdf() {
alert('repetition block added');
}
This, of course, isn't working for me. I'm guessing it's something I'm doing wrong, but I just don't know what. Again, help is greatly appreciated.
P.S. Yes, I'm aware that I can attach my function to the Add button and then just look up the last element in my list, or I could run through all of the elements again. However, I'd still rather do it with an event listener.