set_col_hidden()

  • Parameter(s):
    • $col_name: Column name
    • $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:
    • To hide column in both datagrid and form, set the second parameter to false
    • 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
// hide only in grid display
$dg -> set_col_hidden('employeeNumber');
// hide in both gird and edit form
$dg -> set_col_hidden('DOB', 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));

No related content found.