⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to hide empty fields in view



zenlen
  • profile picture
  • Member

Posted 06 October 2015 - 12:25 PM

Hi there,

 

I created an application that uses forms to enter data in database tables. In this form not all the fields are mandatory. What i need to do is when returning the data  with the view  action to see only the fields that are not empty. Is there any work around? Can someone advice me on that?

 

BR,

Zinonas


Amit Shah
  • profile picture
  • Member

Posted 12 October 2015 - 07:55 AM

Hi there,

 

It is achievable task. Check the state of grocery crud - if its the view...get the primary key, retrieve the row, check the fields that dose not have values, add the same to an array of empty fields. use the unset_read_fields using the built array of empty fields as parameters.. and what u see is only the fields which have values.

 

Happy GCing :)