Results 1 to 2 of 2

Thread: Horizontal Menu using MenuModel not working

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    1
    Vote Rating
    0
      0  

    Default Horizontal Menu using MenuModel not working

    Hi all,
    Sharing with you the piece of code i am working on now to create a horizontal menu with submenu. I was able to create a tree menu using TreePanel but facing some issue in changing that to Horizontal menu using menubar.
    Below is my MenuView file which is extending View:
    ContentPanel createReportMenu() {
    ContentPanel menu = new ContentPanel();
    menu.setAnimCollapse(false);
    menu.setHeading("Report");
    TreeStore<MenuModel> store = new TreeStore<MenuModel>();
    store.add(new MenuModel("Last week", MenuModel.REPORT_TYPE), false);
    store.add(new MenuModel("Last month", MenuModel.REPORT_TYPE), false);
    store.add(new MenuModel("Last year", MenuModel.REPORT_TYPE), false);
    TreePanel<MenuModel> tree = new TreePanel<MenuModel>(store);
    tree.getStyle().setLeafIcon(IconHelper.createStyle("tree-folder"));
    tree.setDisplayProperty("name");
    tree.setAutoSelect(true);
    tree.getSelectionModel().addSelectionChangedListener(
    new SelectionChangedListener<MenuModel>() {
    @Override
    public void selectionChanged(SelectionChangedEvent<MenuModel> se) {
    MenuModel f = (MenuModel) se.getSelection().get(0);
    Dispatcher.get().dispatch(AppEvents.MenuSelected, f);
    }
    });
    menu.add(tree);
    return menu;
    }

    The above code is working and it shows the Menu in tree format.MenuModel file is extending BaseTreeModel. I want the same menu to be shown in horizontal menu bar. Please provide the input how to make those change. Thanks!!

  2. #2
    Sencha User
    Join Date
    Nov 2009
    Posts
    51
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Your question is not clear. You are using tree and you are expecting it to behave like menu. It is not clear what do you mean by horizontal menu. There is MenuBar in GXT if you are looking for similar to that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •