⚠ 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 forum is read-only and soon will be archived. ⚠

How to hide empty fields in view

view read

  • Please log in to reply
1 reply to this topic

#1 zenlen



  • Members
  • Pip
  • 1 posts

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?




#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts

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 :)

Also tagged with one or more of these keywords: view, read

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users