Does the new table component support dynamicColumnSettings?
My main use case is when building our dashboards. I have many tables and each display lots of columns. I programmatically set the column type and formatting is to help reuse formatting conventions. This avoids having to click through the UI to one-by-one to change the formatting.
Hi @huang3r! Yes, dynamic columns are supported as of version 3.7.0. You can find them in the advanced settings menu in the Table Content editor (or search using the command palette).
Thanks @andoliveyou! I see it there - can you give me an example of how to use it for my scenario? Looks like what previously was a single field is now expanded into three fields? Markup 2023-08-08 at 09.29.03.png - Droplr
Sure! When you enable dynamic columns, the table automatically maps over and creates columns for the keys in your data source. In the three inputs (label, format, hidden), you can reference columns using the {{ item }} property to set basic configurations for each column.
For your use case, it sounds like you might want to:
List item
map over the keys to create titles with a function like startCase({{ item }})
consider using the auto format option with predicts the format of your column
As for the formats rules, you can add rules per format using the Column properties editor.
Note that if you've already manually generated columns from the data, you currently need to first clear them off before the dynamic columns can do its thing.
What you guys are showing makes sense - I can programmatically set the label and format for a specific column.
However, my scenario is that I'd like to programmatically set the label and format for all my columns. So I would retrieve a list of columns along with the formatting instructions from the server and provide that variable into the table.
Is that possible? In the solution you guys are showing, would I have to click into the UI for each column name?