Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Shawn on Sep 16, 2008 15:39
open dhtmlx forum
New Menu Object

It seems the examples are outdated for the menu object. Here is what I am trying to do, but I am getting errors:

print('<link rel="STYLESHEET" type="text/css" href="/core/dhx/menu/codebase/dhtmlxtoolbar.css">');
     print('<script language="JavaScript" src="/core/dhx/menu/codebase/dhtmlxprotobar.js"></script>');
     print('<script language="JavaScript" src="/core/dhx/menu/codebase/dhtmlxmenubar.js"></script>');
     print('<script language="JavaScript" src="/core/dhx/menu/codebase/dhtmlxcommon.js"></script>');
print('<div id="toolbar_zone" style="width:600;border :1px solid Silver;"/>');
print("<script>");
print("aToolBar=new dhtmlXMenuBarObject('toolbar_zone','100%',30,'Demo toolbar');");
print("aToolBar.setOnClickHandler(onButtonClick);");
print("aToolBar.showBar();");

for($i=0;$i<count($actions);$i++)
{
//$REQUEST_URI."?module_dm_id=".$actions[$i]->module_dm_id."&portalProcess_1=".$actions[$i]->process
print("aToolBar.addItem(new dhtmlXMenuItemObject('/intrasources/".$actions[$i]->icon."',20,18,0,'new_Id','New tooltip'));");
}

print('function onButtonClick(itemId,itemValue)
{
alert("Button "+itemId+" was pressed");
};');

print("</script>");
print("</div>");
Answer posted on Sep 18, 2008 10:33
The samples from the package are correct. You can check them.

Also please check if all files are included correctly. For example you have included dhtmlxtoolbar.css instead of dhtmlxmenu.css 

If the problem persists, provide the sample where it can be reconstructed (you can contact us at support@dhtmlx.com )