How to add column with DhtmlGrid - connector.

I just want to add more some column such as delete,update which doesn’t exist in table… with DhtmlGrid - connector before sending data to client.

Example ,with delete column, each cell will return a image link to function to delete it’s row. It will be more comfortable than click “delete row” button.

Can you show me how to do it.

Sorry for my bad english.

Thanks.

You can use
$grid->event->attach(“beforeRender”,function($data){
$data->set_value(“dummy1”,"");
$data->set_value(“dummy2”,"");
})
$grid->render(“table”,“id”,“fieldA,fieldB,fieldC,0(dummy1),0(dummy2)”)


Thanks for you support.
Now , i want to add some more column with render->sql.
Please help me.
Thanks again.

You can use the similar approach

$grid->render_table(“table”,“id”,“fieldA,fieldB,fieldC,0(dummy1),0(dummy2)”)

equal to

$grid->render_sql(“select *, 0 as dummy1, 0 as dummy2 from table”,“id”,“fieldA,fieldB,fieldC,dummy1,dummy2”)