Navigate in two menus

Hi, I'm a newbie in enyo/moonstone and i am with a problem with navigation in two menus.

My code:
enyo.kind({ name: "Menu", classes: "moon enyo-fit enyo-unselectable", published: { menuCollection: null, subMenuCollection: null, }, components: [ {name: "globalPanel", kind: "moon.Panels", classes: "enyo-fill moon-16h", arrangerKind: "CarouselArranger", fit: true, components: [ {kind: "moon.Panel", name: "mainPanel", classes: "moon main-panel", components: [{ name: "DatalistMenu", kind: "enyo.DataList", components: [ {components: [ {kind: "moon.Item", name: "menuitem"} ], bindings: [ {from: ".model.text", to: ".$.menuitem.content"}, {from: ".model.id", to: ".$.menuitem.idMenu"}, ], }], }] }, {kind: "moon.Panel", name: "subPanel", classes: "main-panel moon", joinToPrev: true, components: [{ name: "DatalistSubmenu", kind: "enyo.DataList", components: [ {components: [ {name: "submenuitem", kind: "moon.Item"} ], bindings: [ {from: ".model.text", to: ".$.submenuitem.content"}, {from: ".model.id", to: ".$.submenuitem.idMenu"}, ], }], }] }, ] } ], bindings: [ {from: ".menuCollection", to: ".$.DatalistMenu.collection"}, {from: ".subMenuCollection", to: ".$.DatalistSubmenu.collection"}, ], create: function() { this.inherited(arguments); this.menuCollection = new enyo.Collection(); this.subMenuCollection = new enyo.Collection(); this.fetchMainMenu(); }, fetchMainMenu: function() { var records=[]; for (var i = 0; i < 2; i++) { records[i] = new enyo.Model({id: i, text: "Item " + i}); } this.menuCollection.add(records); var records1=[]; for (var i = 0; i < 3; i++) { records1[i] = new enyo.Model({id: i, text: "Item submenu " + i}); } this.subMenuCollection.add(records1); }, });

When navigate in first menu and press "Key DOWN" in last item, the focus is lost. The behaviour i want are if stay in last item, stay focus in this item, same if click in the key DOWN.

Can i help me in the best approach the resolve this problem?

Comments

  • Hi @vem_castro, I tried using your sample code and was not seeing the same behavior in 2.5. Is there possibly something missing from your sample? Alternatively, when interacting with your app, try turning on Spotlight's verbose mode (via enyo.Spotlight.verbose()) and observe the sequence of controls Spotlight attempts to spot when you press 5-way down from the last item. Let us know what you find and/or if you have more information.
  • Thanks aarontam for your response.

    The problem is enyo.DataList. if change to moon.DataList this problem not happen.
  • enyo.DataList doesn't include Spotlight support so you'll likely need to use moon.DataList for Spotlight to behave as you'd expect.
Sign In or Register to comment.