Hello,
I’m trying to populate a coro column (value,label) dynamically from another table using DHTMLXGrid Standard Edition 3.5. Is this possible with this version:
[code] $gridConn = new GridConnector($res,“MySQL”);
$config = new GridConfiguration();
$config->setHeader(array(“Power Supply”,“Plug Number”,“PDU Hostname”));
$config->setColTypes(array(“ed”,“ed”, “coro”)); //ed,ed,coro
$config->setColIds(“ps_detail,plugnum,ps_distr_unit_id”);
$config->setInitWidths(‘120,*’);
$gridConn->set_config($config);
$gridConn->enable_log("/tmp/gridlog.txt");
//create a new options connector to populate the prefrence level selection box
$options = new OptionsConnector($res);
$options->enable_log("/tmp/gridsel1.txt");
//$options->render_table("preference_level","Preference_Level","Preference_Level(value),Preference_Description(label)");
$options->render_table("pdu","id","id(value),hostname(label)");
$gridConn->set_options("ps_distr_unit_id",$options);
//$gridConn->set_options("ps_distr_unit_id",array("1" => "one", "2"=>"two","3" => "three")); //FAIL
$gridConn->render_sql("select id, ps_detail, plugnum, ps_distr_unit_id from ps where server_id = 1","id","ps_detail,plugnum,ps_distr_unit_id");
//$gridConn>render_table("ps","id","ps_detail,plugnum,ps_distr_unit_id"); //FAIL[/code]
The grid is populated as expected, I’m getting and setting values fine but the coro box is not populated with the data from the pdu table. Is this possible with the standard edition?
I see the SQL getting called in the mysql log its just not populating the drop down with that data.
431 Query SELECT `id`,`id` as value,`hostname` as label FROM pdu
431 Query SELECT id, ps_detail,plugnum,ps_distr_unit_id FROM ps WHERE ( server_id = 1)
431 Quit
If this is possible with the standard edition what am I missing?
Thanks in advance!