I have a tabulator component on my form and depending on a user input, I need to update the displayed value in a column.
I can update a column definition by getting the column component and using column.updateDefinition({ }) on it. It works fine except when we need to update the formatter parameters.
Here is a sample column definition:
{"title": "My Title", "formatter": myFormatter, "formatterParams": {"value_type": "units"}}
If I wish to update the value_type, I can't say column.updateDefinition({"formatterParams": {"valueType": "currency"}}) because it throws the following type error:
TypeError: <lambda>() got an unexpected keyword argument 'units'
at app/tabulator/Tabulator/_helpers.py:142
I have a work around by updating the column definition by including the formatter again as such:
column.updateDefinition({"formatter": myFormatter,"formatterParams": {"valueType": "currency"}})
Yeah I guess that's to do with the internals of tabulator js. I don't do anything special here with params so I'm inclined to think your work around is probably the correct solution.
Hi @s-cork,
I have a tabulator component on my form and depending on a user input, I need to update the displayed value in a column.
I can update a column definition by getting the column component and using column.updateDefinition({ }) on it. It works fine except when we need to update the formatter parameters.
Here is a sample column definition:
{"title": "My Title", "formatter": myFormatter, "formatterParams": {"value_type": "units"}}
If I wish to update the value_type, I can't say column.updateDefinition({"formatterParams": {"valueType": "currency"}}) because it throws the following type error:
I have a work around by updating the column definition by including the formatter again as such:
column.updateDefinition({"formatter": myFormatter,"formatterParams": {"valueType": "currency"}})
Just thought might be worth mentioning.