Using Tabulator with Objects #67
-
I have a situation where I want to pass a list of custom objects to Tabulator. All the relevant data is accessible as though the object were a dictionary, i.e. However, Tabulator cells are empty, and I can 'force' with a formatter so that data certainly exists: Is there a better way to handle custom objects? Or am I doing something wrong here? Clone link: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @danbolinson-bt , I won't be able to look at the clone till next week - I'm away right now. Until then you might want to look at the section in the readme about using models. You can supply a custom getter, which can be arbitrarily complex. Eg. def custom_getter(obj, field):
if field == 'foo':
return str(obj[field])
return obj[field] |
Beta Was this translation helpful? Give feedback.
Hi @danbolinson-bt , I won't be able to look at the clone till next week - I'm away right now.
Until then you might want to look at the section in the readme about using models. You can supply a custom getter, which can be arbitrarily complex. Eg.