Does anybody have any samples or tips to create a menu with 1 to 3 level like servoy.com left expandable menu and compatible with smart and webclient?
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