What I’m trying to do:
Work with the tabulator dependency and provide Anvil components as custom editors.
I’ve been playing with the example Tabulator app, and it has a favorite color custom editor. I’ve been trying to get that to work first so I know I understand how to structure my Anvil component. I thought I had a good handle on it, but I can’t get the example editor to work.
Here’s the example app: Tabulator v2 release
What I’ve tried and what’s not working:
When I run the example and click on one of the favorite color entries, the editor opens but does not populate with the cell value. My understanding was that the row would be passed into the editor as self.item, so I put a print(self.item)
in the FavColor __init__
function, e.g.:
class FavColorCell(FavColorCellTemplate):
def __init__(self, **properties):
self.init_components(**properties)
# item is the row data we can use for data bindings
print(self.item)
That always prints out an empty dictionary, and so the editor’s text box does not populate with the current favorite color.
It does work correctly on the way out, if I type in a new favorite color the tabulator row is updated correctly.
Is the example out of date? Is there a new way of getting the tabulator row information into the custom editor? Am I missing something basic entirely?