set_col_hidden()

  • Parameter(s):
    • $col_name: Comma delimited one or more column names
    • $edithidden: Boolean value indicating whether the column is editable. The default value is set to true. This only applies when the edit mode is “FORM”.  A hidden column cannot be editable in “INLINE” edit mode.
  • Description:
    • Hide a column in datagrid when displayed
  • Remark:
    • You can hide more than one columns at a time (version 7.1.5+).
    • To hide column in both datagrid and form, set the second parameter to false
    • Very Important:
      The data are still sent to the browser but hidden using CSS display:none. For sensitive data such as passwords and SSN etc, do not use this method, instead do not include those fields in your SQL at all.
  • Example:
1
2
3
4
5
6
7
8
// hide only in grid display
$dg -> set_col_hidden('employeeNumber');

// hide in both gird and edit form
$dg -> set_col_hidden('DOB', false);

// hide more than one columns at once (version 7.1.5+)
$dg -> set_col_hidden('column1, column2, column3, column4, column5', false);
Tip:
To do the reverse, meaning to have a field appear in grid, but not in the form, use set_col_property set editable to false and hidedlg to true.

1
$dg->set_col_property('COLUMN_NAME', array('editable'=>false,'hidedlg'=>true));