How to use a function to filter data from dhtmlxgrid-connect

I want to use some function to filter data before update data into database.

Example:

$grid->sql->attach(“Update”,“Update tin set trangthai={trangthai},tieudiem={tieudiem},tukhoa=’{tukhoa}’,baivietlienquan=’{baivietlienquan}’ where id={id}”);

I want to use my function :filter(string) to filter “baivietlienquan” field before update.

Can you explain how to do that.

Thanks.

You can use following code:
function custom_filter($action){
$param = $action->get_value(“baivietlienquan”);
$param = filter ($param);
$action->set_value(“baivietlienquan”,$param);
}
$grid->event->attach(“beforeProcessing”,“custom_filter”);

Hi
 I can do it now. Thanks for your great work.
 Your product is the best of the best.