Hello Dinesh,
Generally why would you even use ribbon if you have just 1 element?
The ribbon does not have such functionality, but you may be able to achieve this effect by toggling a class that would hide the menu when you have just 1 option to display. For example:
$("#jqxRibbon ul.jqx-widget-header").toggleClass('hiddenClass')
and set visiblity: hidden for that class as css rule.
However you are likely to get side effects from this like missing borders that would be attatched to the menu.
You could try to just set the height of the element to 0 instead of hiding it. (Should probably use width for vertical ribbon)
.hiddenClass {
height: 0;
min-height: 0;
}
This will keep the border, but the blank space will still be there and you will see missing side borders on that window, so to adjust that you will probably need to move the content.
$("#jqxRibbon .jqx-widget-content").toggleClass('moveContentClass')
and set that moveContentClass with negative margin.
e.g. for top placed ribbon
.moveContentClass { margin-top: -15px; }
Though this is just a suggestion and is entirely up to you on how to implement it.
There are probably others maybe even more efficient methods to achieve this.
Best Regards,
Vladimir
jQWidgets Team
http://www.jqwidgets.com