Connector + Grid, Extra data insert

Hello,

I use dhtmlxGrid with dataproccessor and Connector. When i add row to the grid, i need to add one more field to database which not in fields list for this grid.

my connector string:
$grid->render_table(“attributes”, “id”, “name,vendor_id,list_id,unit_id,required,hidden”, “”, “catalog_id”);
where catalog_id is extra field which should not be shown in grid but should be added in SQL query.

my proccessor string:
attrGrid.addRow((new Date()).valueOf(), [text, ‘’, ‘’, ‘’, 0, 0, currentCatalogId]);

where currentCatalogId is value for catalog_id

but in the server log i can see this query :
INSERT INTO attributes(name,vendor_id,list_id,unit_id,required,hidden,catalog_id) VALUES (‘New Row’,’’,’’,’’,‘0’,‘0’,’’)

where value for catalog_id is ‘’ instead of my value

Please advise, how i can realize such task?

Thank you.
Alex.


function set_catalog($action){
     $action->add_field("catalog_id",1); //instead of 1 , you can use value from session 
}

$grid->event->attach("beforeProcessing","set_catalog");
$grid->render_table("attributes", "id", "name,vendor_id,list_id,unit_id,required,hidden", "", "");

Thank you Stas

that’s what i need indeed.

Regards,
Alex.