40
Views
2
Comments
[OutSystems Data Grid] Creating Dynamic Columns - Dropdown
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

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": ""}],

    "metadata": {

        "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

2019-11-14 12-29-35
Ramon Pigmans

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.