I am having issues with the submenus being displayed when I switch over to Dynamic Loading. Originally I was using;
dhxMenu = dhxLayout.cells(“a”).attachMenu();
dhxMenu.setIconsPath(“dhtmlxMenu/codebase/imgs/”);
dhxMenu.loadXML(“common/dhxmenu.xml?etc=” + new Date().getTime(), function() {});
And dhtmlxmenu.xml had the following structure;
<?xml version="1.0" ?>This worked fine however I wanted to switch over to Dynamic Loading since each menu may contain various items depending on the site location. In my main program I changed the code to;
dhxMenu = dhxLayout.cells(“a”).attachMenu();
dhxMenu.setIconsPath(“dhtmlxMenu/codebase/imgs/”);
dhxMenu.enableDynamicLoading(“php/dhtmlxmenu2.php?sitename=VW_DE_Newark&etc=” + new Date().getTime());
and the dhtmlxmenu2.php file is as follows;
<?php require_once('config-4.php'); header("Content-type:text/xml"); echo '<?xml version="1.0"?>';echo ‘’;
$thesitename = $_GET[‘sitename’];
$link = mysql_pconnect($mysql_host, $mysql_user, $mysql_pasw);
$db = mysql_select_db ($mysql_db);
$res = mysql_query (“SELECT DISTINCT l1nodeLbl FROM rothdna.nodeinfo WHERE siteName='”.$thesitename.“’ AND (l1nodeLbl LIKE ‘%Lighting%’ OR l1nodeLbl LIKE ‘%RTU%’) ORDER BY l1nodeLbl”);
while ($out = mysql_fetch_object($res)) {
if ($out->l1nodeLbl==“Lighting”){
echo ‘’;
echo ‘’;
echo ‘’;
echo ‘’;
echo ‘’;
echo ‘’;
echo ‘’;
echo ‘’;
} else {
echo ‘’;
}
}
mysql_free_result($res);
echo ‘’;
mysql_close($link);
?>
If I run just the PHP program with a sitename. For example;
…/php/dhtmlxmenu2.php?sitename=VW_MI_Flint
I get the following displayed;
<?xml version="1.0" ?>The problem i am running into is when I bring up the web page I only get the Main items. i do not get the submenus. Attached is a screen shot of the Menu being display but again, if I move my mouse over to Lighting I do not get a drop down of Alarms, Configuration, etc.
Can anyone plesae let me know what I am missing?
Thank You,
Todd