set_col_readonly()

  • Parameter(s):
    • $col_names: Comma delimited one or more column names
  • Description:
    • Set one more more columns as read only field
  • Example:
1
$dg -> set_col_readonly("SSN, lastname, employeeNumber");

Remark:

To allow add for read-only field when adding new records, use “jqGridAddEditAfterShowForm” event, and conditionally remove the “disabled” attribute based on operand, which is either “edit” or “add”.

1
2
3
4
5
6
$dg -> add_event('jqGridAddEditAfterShowForm',
  'function(e, form, oper){
    if (oper == "add") {
      $("#COLUMN_NAME").removeAttr("disabled");
    }
  }'
);