I’m working with the Datagrid in WeWeb and trying to implement a feature where users can dynamically choose which columns to display.
I see there’s a manual option to add columns in the Datagrid settings, but there’s also the possibility to bind the “Columns” property. However, I couldn’t find clear documentation or examples on what the expected JSON structure is for the binding.
Can anyone please share the correct JSON format to bind dynamic columns in the Datagrid component?
Ideally, I’d like to generate this array based on user input (e.g. checkboxes or a settings panel).
It would be nice to have the new components such as datagrid open sourced as all of the other components in the weweb-assets directory @Raphael, this way we could answer such questions.
I just spent awhile trying to figure out how to do flex columns and date column when binding the columns.
I actually figured it out.
If anyone is still looking for how to do this kind of stuff let me know and I’ll write a tutorial out for it if a few people are interested.
For anyone with the know how, I figured this out by forking the component and looking at the code all the answers are there. There’s lots of options we have with binded columns that weweb has no mention of in the docs. Still seeing what else is possible.