[Data Grid] How to display a value of 0

Forge Component
(28)
Published on 24 Sep (3 weeks ago) by OutSystems R&D
28 votes
Published on 24 Sep (3 weeks ago) by OutSystems R&D

Hi there,

If the value is 0, it does not appear in the Grid (yellow cell). Is there a way to display it?

Best Regards,

Kosuke Ogawa



What if you change the DefaultValue Property to something else (e.g. -1)?

Kilian Hekhuis wrote:

What if you change the DefaultValue Property to something else (e.g. -1)?

Thank you for your reply.
Even if the DefaultValue Property is changed to -1 or Null, not displayed.


Solution

Self-solving!

REST API response (JSON) did not contain 0.
So when I set the Is Mandatory property to "Yes", it now includes 0.



Solution

Hi ES-KO,

Thanks for the feedback. However, if a REST API does not send a certain Attribute value, the Attribute gets the default value. So if "Integer" isn't sent at all, the Structure Attribute will hold the value 0, just as if it is sent. So that can't be it!

@Kilian: DataGrid is a bit of strange component. It need REST calls to retrieve it's data (Yeah, more AO :( ) and I'm sure that parsing the data doesn't go through standard OutSystems processes and that everything is handled internally in JavaScript and therefor doesn't get default values (since undefined or null are valid in javascript). 

@Vincent: Right, that would explain, thanks for the update.