Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Hiding "Empty Menu" showing in menu using ResultTree datasource

    I apologize in advance if this has been covered somewhere but having spent a lot of effort going thru any forum that mentions "menu" with no success, I have resorted to a posting.

    I am trying to use the Menu class to display a tree menu but it shows "[Empty menu]" for nodes that have no children.

    Is there a way to disable showing empty child nodes and also not show the little right arrow if there are no child nodes?

    Code snippet:
    ResultTree rt = new ResultTree();
    rt.setDataSource(DataSource.get("menuDs"));
    myMenu = new Menu();
    myMenu.setData(rt);

    I know I can use this to not show right arrow at all:
    myMenu.setShowSubmenus(false);
    However this removes the right arrow from all menu options even when there are some that do have children.

    Any help would be much appreciated.

    #2
    Solved: Set the property to force loading the entire menu up front instead of on demand and the empty menu options no longer show so all good thanks.

    For those who come across this set this:
    rt.setLoadDataOnDemand(false);

    Comment

    Working...
    X