Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Anton on Mar 26, 2009 02:30
open dhtmlx forum
Images don't show

This is my code
var historyMenu = new dhtmlXMenuObject(null, "standard");
historyMenu.setImagePath("dhtmlxMenu/codebase/imgs/standard/");
historyMenu.renderAsContextMenu();
historyMenu.addNewChild(historyMenu.topId,0,"rollback","Rollback", false, "rollback.gif");

but image in menu doesn't show, it src="imgs/standardrollback.gif".
What is wrong?

Answer posted by Alex (support) on Mar 26, 2009 07:35

The menu has two methods to set image path:

- setImagePath - sets path to standard images (which are necessary for setting skin)

- setIconsPath - sets path to the icons

In your case the code can be the following:

var historyMenu = new dhtmlXMenuObject(null, "standard"); 
historyMenu.setImagePath("dhtmlxMenu/codebase/imgs/");

historyMenu.setIconsPath("dhtmlxMenu/codebase/imgs/standard/");

...


Answer posted by Anton on Mar 26, 2009 07:57
Thank you it works