如何创建TabView?

时间:2011-11-02 22:33:25

标签: javascript sproutcore

我很感激帮助您了解如何创建TabView。到目前为止,我尝试将以下内容添加到应用程序的主JS文件中,但我一直收到一个错误,即设计被称为“未定义”,即SC.TabView未定义。

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

1 个答案:

答案 0 :(得分: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