Created
March 25, 2010 16:24
-
-
Save enyo/343762 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The menu: | |
menu: SC.SourceListView.design({ | |
layout: { top: 0, left:0, bottom: 0, width: 250 }, | |
contentValueKey: 'displayName', | |
contentBinding: 'Settings.menuItemsController.arrangedObjects', | |
selectionBinding: 'Settings.menuItemsController.selection', | |
localize: YES, | |
rowHeight: 24, | |
hasContentIcon: YES, | |
contentIconKey: 'icon', | |
exampleView: Settings.MenuItemView, | |
isEditable: NO, | |
canEditContent: NO, | |
canReorderContent: NO, | |
canDeleteContent: NO, | |
destroyOnRemoval: YES | |
}), | |
// Menu items controller: | |
Settings.menuItemsController = SC.TreeController.create( | |
/** @scope Settings.menuItems.prototype */ { | |
contentBinding: 'Settings.settingsController.menuItems', | |
allowsEmptySelection: YES, | |
treeItemIsGrouped: YES | |
}) ; | |
// Settings controller: | |
Settings.settingsController = SC.ObjectController.create( | |
/** @scope Settings.settingsController.prototype */ { | |
menuItems: [] | |
}) ; | |
// Main: | |
Settings.main = function main() { | |
var menuItems = [], generalMenuItems = []; | |
// Step 1: Instantiate Your Views | |
// The default code here will make the mainPane for your application visible | |
// on screen. If you app gets any level of complexity, you will probably | |
// create multiple pages and panes. | |
Settings.getPath('mainPage.mainPane').append() ; | |
generalMenuItems.push(SC.Object.create({ displayName: "_General".loc() })); | |
generalMenuItems.push(SC.Object.create({ displayName: "_Bank".loc() })); | |
generalMenuItems.push(SC.Object.create({ displayName: "_Lyoness".loc() })); | |
menuItems.push(SC.Object.create({ displayName: "_General".loc(), treeItemChildren: generalMenuItems, treeItemIsExpanded: YES })); | |
Settings.settingsController.set('menuItems', menuItems); | |
} ; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment