[Data Grid Reactive] DropdownListType is display 0 when having 0 or nullidentifier in foreign key field
Forge component by OutSystems R&D
Application Type
Reactive
Service Studio Version
11.11.4 (Build 43813)
Platform Version
11.12.0 (Build 30456)

I found when a foreign key column does not have a value, i.e. 0 stored in db, the DropdownListType column type is showing "0" instead of a blank value.

Is there any workaround to now showng the 0 value?

This is the settings I have.

Thanks!

Solution

Hello @Soon ,

Indeed we need to improve the way to show empty data using the data grid, but for now, we have two solutions to propose:

Solution 1:

Include the empty option as an option in the dropdown values. In the sample we set the value as (empty) just to show that two different solutions were being give but you can set it to ""

Solution 2:

In order to achieve that requirement you'll need to extend the DataGrid behavior. Using the OnInitialize event, you need to use JS to set the field value as undefined when the value is 0.

Please keep mind, that for your use case, you need to replace the row.dataItem.[your data source field Name].

Also, this hasn't been tested for all possible use cases or that it cover all of your requirements, so we cannot assure that it will work for all use cases. 

In attachment, you can find a sample OML with this implementation.

Please let us know if this helps.

Bruno Martinho

EmptyDropdown.oml

Hi Bruno,

Thanks for your response. 

Yeah, I found out the solution#1 earlier as well to workaround that. I will keep solution #2 as another possible workaround if I need to go down to that path.

Regards,
Soon

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