Linking select controls in the lightbox - server side

Hello,
I try to customize lightbox with some combobox.
I have 2 combobox with parent-child relation.
In MySQL DB there are these table:

  1. category
    id - int 5 - PK
    descr - varchar 100

  2. activity
    id - int 5 - PK
    id_category - int 5 FK
    descr - varchar 100

In .PHP:

[code] $list_category = new OptionsConnector($res, “MySQLi”);
$list_category->render_table(“category”,“id”,“id(value),descr(label)”);

$list_activity = new OptionsConnector($res, "MySQLi");
$list_activity->render_table("activity","id","id(value),descr(label),id_category");[/code]

In Javascript I try to use this example:
docs.dhtmlx.com/scheduler/sampl … htbox.html
but not working.

I think problem is format of child table “activity” because in example there’s a JSON with parent as JSON Array.

Can anyone help me?
Is there an example for linking server-side selects?

Thanks,
William

Yep, the sample uses a custom json structure, which is not the same as result of connector.
You can change the logic of parent_onchange like next

var parent_onchange = function(event) {
	var new_child_options = dhx.ajax.get("childdata.php?dhx_filter[id_category]="+this.value, function(res){
                var data = JSON.parse(res.xmlDoc.responseText);
		update_select_options(scheduler.formSection('child').control, data);
        }); 

};

Above code assumes that you are using JSONOptionsConnector for childdata.php

Thanks very much! Now it’s works!