Hello,
I'm trying to create a dynamic DataGrid with dynamic columns and content.
I can create the grid with the columns and the content, in this format:
{
"data": [{"Vendedor":"", "Janeiro":"", "Estado":""}],
"metadata": {
"Vendedor":"String",
"Janeiro":"Number",
"Estado":"Dropdown"
}
But I need to have dropdown columns, with different options, and I can't find a way to send the options to the column.
I already tried to create the columns like this:
"data": [{"Vendedor": "", "Janeiro": "", "Estado": ""}],
"Vendedor": { "type": "String", "header": "Vendedor"},
"Janeiro": { "type": "Number", "header": "Janeiro"},
"Estado": { "type": "Dropdown", "header": "Estado", "options": ["Concluído", "Pendente"]}
But the Grid creates multiple columns with the headers like "header" and "type", and doesn't create the options.
Does someone know a workaround to create the dropdown columns with the options?
Thank you in advance,Sofia Rodrigues
Hi Sofia,
The visibility of the options depends on whether the grid is in edit mode. The documentation says "This column when in edit mode, will enable users to see a list of possible values for the column and change accordingly."
So set Grid > OptionalConfigs > AllowColumnEdit to True to set the grid in edit mode.
Please let me know if it works.
Ramon
hallo @Sofia Rodrigues ,
can you check this
https://www.outsystems.com/forums/discussion/86332/creating-dynamic-columns-on-screen/