How can I place hyperlinks in the menu bar the control cells in my dhtmlxLayout? Can someone please provide a couple samples?
Hello
You can try to use either href or userdata tag:
- href tag sample is dhtmlxMenu/samples/03_features/07_hrefs.html
- userdata:
<item …>some_url_here
menu.attachEvent(“onClick”, menuClick);
function menuClick(id) {
var href = menu.getUserData(id, ‘href’);
}
If xml configuration isn’t used, you can use setHref or setUserData methods to set href.
What am I doing wrong with this. When I click on the “Bug reporting” menu item cell “b” in the layout does change but I get “page cannot be displayed”.
[code]menu.addNewChild(“help”,2,“bugrep”,“Bug Reporting”,false,“bug_reporting.gif”);
menu.attachEvent(“onClick”,function(id){
var url = menu.getUserData(id,“www.google.com”);
dhxlayout.cells(“b”).attachURL(url);
})[/code]
Try to set full url - with http://
menu.attachEvent(“onClick”,function(id){
var url = menu.getUserData(id,"[b]http://[/b]www.google.com");
dhxlayout.cells("b").attachURL(url);
})
Sorry
there was a mistake in the previour answer:
menu.attachEvent(“onClick”,function(id){
var url = “http://www.google.com”;
dhxlayout.cells(“b”).attachURL(url);
})