# Servoy.com left expandable vertical menu

**URL:** <https://forum.servoy.com/t/servoy-com-left-expandable-vertical-menu/11707>\
**Category:** Classic Servoy\
**Created:** [February 3, 2010, 12:54pm UTC](https://forum.servoy.com/t/servoy-com-left-expandable-vertical-menu/11707 "2010-02-03T12:54:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erdione](https://avatars.discourse-cdn.com/v4/letter/e/e9a140/32.png) [@erdione](https://forum.servoy.com/u/erdione)\
**Post date:** [February 3, 2010, 12:54pm UTC](https://forum.servoy.com/t/servoy-com-left-expandable-vertical-menu/11707/1 "2010-02-03T12:54:26Z")

</div>

Does anybody have any samples or tips to create a menu with 1 to 3 level like [servoy.com](http://servoy.com) left expandable menu and compatible with smart and webclient?

---

<div class="post-metadata">

**Author:** ![Gordon](https://avatars.discourse-cdn.com/v4/letter/g/3da27b/32.png) [@Gordon](https://forum.servoy.com/u/Gordon)\
**Post date:** [February 4, 2010, 8:01am UTC](https://forum.servoy.com/t/servoy-com-left-expandable-vertical-menu/11707/2 "2010-02-04T08:01:49Z")

</div>

Hi

You could try building the menu in html and rendering it each time the user selects an option ie re draw the whole thing.

This is a an extremely rough example but does work. Servoy renders this sufficiently quickly that you can do some pretty cool stuff with decoration and the like too.

//variable to stick the result into that is displayed on the page as an un editable html area  
var htmlField = ‘’;

//This is the function you want the clicked menu to call  
function htmlFieldAction()  
{  
application.output(‘Link number: ‘+arguments[0]+’ clicked…’);

}

//this renders the html in the first place. Note I have had to stick an IF in here to change the font size depending on whether the user is using web or  
//smart client. Its probably a css issue that I have not tracked down yet and will be blindingly obvious to others

function populateHtml()  
{  
var navHtml = ‘’;

navHtml = ‘’;  
navHtml += ‘’;  
navHtml += ‘a {color:#999999; text-decoration: none; font-size: 9px; font-weight:450;}’;  
navHtml += ‘a:hover {color:#717171}’;  
navHtml += ‘a.on {color:#363636; font-weight:bold }’;  
//navHtml += ‘a:link{color:#000000}’;  
navHtml += ‘’;

// Simple loop, make 5 menu items  
for(var i=0; i\<5; i++)  
{  
navHtml += 'This is link ‘+i+’  
';  
}

navHtml += ‘’;

htmlField = navHtml;  
}

Cheers  
Gordon
