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

Inline Edit Actions Column

Inline edit mode also comes with actions column with edit and delete buttons. Use add_column method to add “actions”. In formatoptions, specify the following property to display or hide edit and delete buttons:

  • delbutton – true or false
  • editbutton – true or false

Note that when use actions column, it is not necessary to specify edit options in enable_edit method. An advantage using actions column is that it’s possible to have row-level permission. Please see datagrid row-level edit permission example.

1
2
3
4
5
6
7
8
9
10
11
12
$dg = new C_DataGrid("SELECT * FROM orders", "orderNumber", "orders");

// enable edit - but no need to specify 2nd parameter because we will be using actions column
$dg -> enable_edit("INLINE");

$dg->add_column("actions", array('name'=>'actions',
    'index'=>'actions',
    'width'=>'70',
    'formatter'=>'actions',
    'formatoptions'=>array('keys'=>true, 'editbutton'=>true, 'delbutton'=>false)),'Actions');

$dg -> display();

See Live Example!