Set the active menu option in an (Extension Library) Navigator control


//add a clientside onclick event to all navigator options that sets the active option
//replace 'navigator1' with the id of your navigator
dojo.addOnLoad( function() {
	dojo.query("li", dojo.byId("#{id:navigator1}") ).forEach( function(navNode) {
		dojo.query("a", navNode).connect("onclick", function() {
		
			//clear lotusSelected class from all navigation options
			dojo.query("li", dojo.byId("#{id:navigator1}") ).removeClass("lotusSelected");
			
			//mark current node as selected
			dojo.addClass(navNode, "lotusSelected"); 
		});
	});
});
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...