anvilistas / tabulator

Anvil Wrapper for Tabulator
MIT License
18 stars 5 forks source link

Using data tree module with model objects #146

Closed meatballs closed 6 months ago

meatballs commented 6 months ago

I can get the data tree module working with ordinary lists of dicts as the data, but I can't do the same using models.

here's an MWE: https://anvil.works/build#clone:XHBBM73R6JPWNNQ5=VCQ7TPPWC3ICYZWYFLXNOGX4

s-cork commented 6 months ago

https://anvil.works/build#clone:6IXWZFBCARX4E6CH=KKYGNYGHB45MHRW753CQGRAH

Data from a model is effectively lazy loaded. So adding hidden column for _children should fix that. (Since there was no _children column tabulator didn't know there was any data for _children) Also changed the model class to set _children as None rather than an empty list.

meatballs commented 6 months ago

agghhhh. That simple! Thank you kindly