Thank you for the links.
I was able to show the data but not edit it…
The guide says I should be able to edit the data as well, so I’m not sure what I wrote wrong in my code…
This is my code:
if ($conn->is_select_mode())//code for loading data
$conn->render_sql("Select * from employees, login_info where login_info.employee_id=employees.id",
"employees.id","id, first_name, login");
else //code for other operations - i.e. update/insert/delete
$conn->render_table("employees","id","first_name");
$conn->render_table("login_info","id","login");
There is no way to edit data in many tables at once.
You can configure connector to load data from many tables, and save only into one ( one render_table command only )
I’m able to show the data of multiple tables.
However, as you said I should only be able to “edit the main table, not the joined one” But unfortunately I cannot edit even the main table with the following code:
if ($conn->is_select_mode())//code for loading data
$conn->render_sql("Select * from employees, login_info where login_info.employee_id=employees.id",
"employees.id","id, first_name, login");
else
$conn->render_table("employees","id","first_name");
The changes don’t get saved…
I also tried a complex query, but that also doesn’t work:
if ($conn->is_select_mode())//code for loading data
$conn->render_sql("Select * from employees, login_info where login_info.employee_id=employees.id",
"employees.id","id, first_name, login");
else
$conn->sql->attach("Update","Update employees set first_name='{name}' where id={id}");
$conn->render_complex_sql("employees","id","first_name");
First I’d like to be able to edit just one table with a JOINED view, if that works I wanna try going further by making the joined table also editable.
Now I can’t do either…
What I don’t understand in this example is the ‘a.id’, where does this ‘a’ come from?
↓↓↓↓↓
if ($grid->is_select_mode())//code for loading data
$grid->render_sql("Select * from tableA, tableB where tableA.id=tableB.id",
"a.id","name,price,other");
else //code for other operations - i.e. update/insert/delete
$grid->render_table("tableA","id","name,price");
Shouldn’t it be ‘tableA.id’ ?
I used ‘employees.id’ in my code above, maybe this is why I cannot save my edits.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan