set icon for dijit.MenuItem
问题 We have a case where we only know the icon for a menu item at runtime. I know there is a iconClass parameter for a diji.MenuItem , but this is of little help unless we dynamically add CSS rules at runtime with dojox.html.insertCssRule - there must be a better way! Here is an example of what we are trying to do: pMenu = new dijit.Menu({ targetNodeIds: ["NEW_APP"], leftClickToOpen: true }); pMenu.popupDelay = 100; pMenu.addChild(new dijit.PopupMenuItem({ label: "clocks", iconSrc: "image/clocks