2011-11-02 52 views
2

我很感謝幫助理解如何創建一個TabView。到目前爲止,我嘗試將以下內容添加到應用程序的主JS文件中,但是我一直收到一個錯誤消息,稱該設計在「未定義」上調用,即SC.TabView未定義。如何創建TabView?

Todos.DashboardTabs = SC.TabView.design({ 
    tabLocation: SC.TOP_LOCATION, 
    items: [{ title: "Projects", value: Todos.TodoView }], 
    nowShowing: Todos.TodoView // A template + view I created 
} 

回答

0

我TabView的是這樣的:

administrationContentView: SC.TabView.design({ 
     layout: { 
      top: 10, 
      bottom: 50, 
      left: 10, 
      right: 10 
     }, 
     nowShowing: 'EurekaJView.AlertAdministrationView', 
     itemTitleKey: 'title', 
     itemValueKey: 'value', 
     items: [ 
      {title: 'Alerts', value: 'EurekaJView.AlertAdministrationView'}, 
      {title: 'Chart Groups', value: 'EurekaJView.InstrumentationGroupsAdministrationView'}, 
      {title: 'Email Recipients', value: 'EurekaJView.EmailRecipientsAdministrationView'}, 
      {title: 'Instrumentation Menu', value: 'EurekaJView.TreeMenuAdministrationView'} 
     ] 

    }), 

這是SC 1.6。完整的源代碼可在此處獲得:

https://github.com/joachimhs/EurekaJ/blob/master/EurekaJ.Manager/src/main/webapp/sc1/js/views/administration/administration_pane.js