I’m just getting my feet wet with dhtmlx, and I’m having some trouble populating a form’s select box options from my database via the form connector. This seems very basic, and I think perhaps I’ve missed something.
Upon page load, in one of the cells, a blank form is loaded, which contains only a single select box.
ksForm = eveLayout.cells(“b”).attachForm();
The form looks like this:<?xml version="1.0" encoding="UTF-8"?>
I have an event in the grid on this page that’s supposed to populate the options of the select box from the database:
Here’s the guts of that …
$dbh = mysql_connect(“localhost”,“root”,“xxxxxx”);
$hostid = $_REQUEST[‘id’];
$formConn = new FormConnector($dbh,“MySQL”);
$optsConn = new OptionsConnector($dbh);
$optsSQL = "select kickstarts.id as value, kickstarts.name as label from kickstarts ".
"inner join distro_kickstarts on distro_kickstarts.kickstartid = kickstarts.id ".
"inner join distros on distros.id = distro_kickstarts.distroid ".
“inner join hosts on hosts.distroid = distros.id where hosts.id = $hostid”;
$optsConn->render_sql($optsSQL, “”, “value,label”);
… now, thanks to the firebug plugin in Chrome, I can see what data is being returned:<?xml version='1.0' encoding='utf-8' ?>
These are the options that I expect… but… these options don’t get populated in the select box in the form.
What might I be missing with how this works?