Update single table from multiple table query


#1

Hello Guys,

I have a grid with a complex query made up of many joins however I only want to update one table when a change is made to a editable column.
I’ve written custom update for DP before however i want to use the simpler version below for some of the tables.

if ($grid->is_select_mode())//code for loading data $grid->render_sql("Select a.*, b.* from tableA a, tableB b where a.id=b.id", "a.id","name,price,other"); else //code for other operations - i.e. update/insert/delete $grid->render_table("tableA","id","name,price");

However, the problem i have is all of our non editable fields at the front of the grid, so since the above example only uses the fields in order, it tries to update the wrong fields in the table we want to update.

Basically what we have is:

if ($grid->is_select_mode()) $grid->render_sql("Select a.*, b.* from tableA a, tableB b where a.id=b.id", "a.id","tes,test,test1,name,price,other"); else $grid->render_table("tableA","id","name,price");

So the connector tries to do -

UPDATE tes=name, test=price WHERE id=id;

Is there a way around this issue with out writing custom update function every time?

Thank you