anvilistas / tabulator

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

how to handle on_rendered with custom formatters? is adding **kwargs sufficient? #133

Closed mcmasty closed 1 year ago

mcmasty commented 1 year ago

Describe the bug My custom formatter stopped working. My code basically is identical to the delete_link_formatter. I'm curious of just slappipng a **kwargs in the definition will be sufficient, or I need to be aware of importance of on_rendered

i.e. from def delete_link_formatter(cell): to def delete_link_formatter(cell, **kwargs):

Error Message

TypeError: delete_link_formatter() got an unexpected keyword argument 'on_rendered'
at app/tabulator/Tabulator/_custom_modules.py:
called from app/tabulator/Tabulator/_custom_modules.py:109
called from app/tabulator/Tabulator/_helpers.py:153

To Reproduce Steps to reproduce the behaviour (including a clone link when applicable):

Clone & Run the Demo app

https://anvil.works/build#clone:JVL5ORAAPZ6SVWDU=JA27THWRHTGHH7XK4U36PRN4%7CTGQCF3WT6FVL2EM2=SMZUM3MICK67JEIH25IJXCWP

or visit this live app

https://example-tabulator.anvil.app/

Expected behavior It's acceptable for the Tabulator Wrapper to introduce breaking changes, I'm just not sure the best way to handle it.

s-cork commented 1 year ago

Yes just include **kws. I think all the documented examples include **params

s-cork commented 1 year ago

I'll fix up the example too. Thanks for highlighting.

s-cork commented 1 year ago

the breaking change has now been reverted