How to hide a field in child table view?

In many cases, your application might have a child table, like this:

An example child table in an AppGini application. We want to hide some columns from that table.

Let’s say we want to hide the Company and Open columns from that child table. You can add a CSS rule to hide specific columns from the child table. In the generated hooks/footer-extras.php, add code similar to this:

In the above code, replace:

  • child-table with the name of the child table, “quotes” in the above example.
  • lookup-field with the name of the lookup field in the child table that points to the parent table, “company” in the above example.
  • field-to-hide name of the child table field to hide, “company” in the above example

You can repeat the above rule for every column you want to hide. So, to hide the company and open fields:

The result looks as follows:

Company and Open fields now hidden after applying the above CSS rules.

Published by Genedy

I'm the founder of BigProf Software. We're a tiny team of developers who create tools that make it easy (and affordable) for anyone to create connected business applications that work from any device with a browser.

4 replies on “How to hide a field in child table view?”

  1. Hello,
    How can I use this CSS rule if there are several tables with child tables in the application and you want to always hide the same column (the same lookup field)?
    Regards Stefan

    1. You would repeat the CSS rule for each table, either by duplicating the code lines above and changing the table and field names, or by combining the CSS selectors into one rule set (separated using commas).

      1. That works, thank you. However, if there are several parent tables with children’s tables that all use the same lookup field, the above mentioned CSS rule in footer-extras.php only the first parent-table. So that works with the other parent tables with child tables I have written the CSS rules in the table name_dv function in the table name.php in the hooks folder. Here I had to omit the area “# panel_child-table-lookup-field”.

        1. > Here I had to omit the area “# panel_child-table-lookup-field”.
          You’re right indeed. The rule would then look like this:
          .tablename-fieldname { display: none; }

Comments are closed.