Hi there -
Background info -
I have a database table called sched_student_course with the following fields:
id, student_id, course_id, company_id
I use tree_multitable_connector.php in my connector.php file to create the tree with the following code:
$tree->setMaxLevel(0);
$level = $tree->get_level();
switch($level) {
case 0:
$tree->render_table(“sched_student_course”,“id”,“student_id,course_id,company_id”,“”,“”);
break;
}
I just want a single level tree to appear with the student_id numbers for now and so the above works and displays the tree just fine.
On the client side, I can do: tree.deleteItem(tree.getSelectedItemId();
and it works fine and the record gets deleted in my database table.
I want to be able to insert records in the database table and be able to set the other columns (course_id, company_id) as well.
I can, for example, do: tree.insertNewItem(0,(new Date()).valueOf(),5);
and it will display the new item in the correct place in the tree on the screen, but of course it doesn’t get inserted into the database table.
I’ve poured through all the documentation, examples and forum posts and tried various ways of inserting the record into the database while setting the other fields and have failed. It seems there are quite a number of ways to do what I’m trying to do from using beforeUpdate attached events on the client side to the server side, using dataprocessor or connector, custom code, etc, etc. I’ve tried a ton of different ways to do it but I’m totally confused as to the correct and most simplest way of doing it so I thought I’d just ask for some help.
Please help with some simple examples for the above!!
BTW - I’ll mentioned that I’ve used 02_dhtmlxTree_outer_drag.html as my starting point example because I’m using data from a set of scheduler events as what I’m putting in the extra fields (course_id, company_id) so that you know what the basic environment is.
Thanks in advance,
Irv