Sproutcore SC.MenuPane keep/remember/visible selected item

31 Views Asked by At

I have a working popup button with menu 2 options, and need to 'keep/remember' the selected item visible to the user, in other words, the next time the menu pops up, the previous made choice should be visible (eg highlighted).

selectMenuButton: SC.PopupButtonView.extend({
                    layout: {left:10, bottom: 10, height: 18, width:100},
                    controlSize: SC.SMALL_CONTROL_SIZE,
                    title: 'Menu',
                    menu: SC.MenuPane.extend({
                      layout: { width: 150 },
                      items: [
                      { title: 'option1', checkbox: YES, action: 'action1',target: 'App.Controller1'},
                      { title: 'option2', checkbox: NO, action: 'action2',target: 'App.Controller2'}
                      ]
                    }),
                }),

I tried classnames css .active or .sel, but that didn't work. Please some advice, thanks in advance.

0

There are 0 best solutions below