Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Le Van Van on Jun 15, 2009 08:03
open dhtmlx forum
How to use a function to filter data from dhtmlxgrid-connector before update

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.
Answer posted by dhxSupport on Jun 16, 2009 03:52
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");


Answer posted by Le Van Van on Jun 16, 2009 04:55
Hi
 I can do it now. Thanks for your great work.
 Your product is the best of the best.