877-GRID-666 24/7 online support 604, Tower A, New Trade Plaza, N.T., Hong Kong

set_edit_condition()

  • Parameters:
    • $edit_conditoin: An array stores edit permission condition.
  • Description:
    • Set row-level permission condition for editing.
  • Remark:
    • This works for INLINE ONLY by hiding the edit icons using javascript, CSS
    • For that reason, developers should still validate user permission at the database or on the server side.
    • For complex conditions, use add_event and javascript. See row-level edit permission example.
  • Example:
1
2
$dg -> enable_edit('INLINE', 'CRUD');
$dg -> set_edit_condition(array('status' => '=="Shipped"', '&&', 'customerNumber' => '==114' ));

The above code snippet generates javascript that validates Status and customerNumber value. If both are true, the edit icon will appear.

phpGrid_Custom_Edit_Condition_without_using_set_edit_condition