What I’m trying to do:
Raise the x-refresh event on a repeating panel within a data grid from the repeating panel’s item template to put focus on the first element of the last line of the repeating panel.
I don’t get this error when I use the method in a standard anvil event, only in a JS Event and it seems to apply to all instances of raise_event, even on self (which is passed to the function itself) and to raise_event running within other method calls called from this function.
What I’ve tried and what’s not working:
I can use self.parent.items to successfully add a new row to the repeating panel, but any method call like raise_event gives the NoneType Error.
Code Sample:
self.parent.raise_event('x-refresh')
I put this within an instance method of the item template that triggers on focus loss from the last item in the template row to add an additional row.
I register this event with JQuery to the last button like this (record_button_dom is a JQuery object made from get_dom_node obj) and add_row is my method:
record_button_dom.focusout(lambda event: self.add_row(event))