2011-05-24 53 views
0

我创建了一个带有tabview菜单的基本页面。 其中一个选项卡指向分割视图。现在这个分割视图在页面重新加载时工作正常。 导航通过不同的标签工作但是加载分割视图的标签永远不会再显示,如果我导航到不显示的splitview,然后做一个页面重新加载splitview加载罚款......如果我离开和返回拆分视图不加载..splitview不从tabview菜单加载

我正在使用最新的sproutcore。

任何一个想法在哪里看?

// This page describes the main user interface for your application. 
App.mainPage = SC.Page.design({ 

mainPane: SC.MainPane.design({ 

childViews: [SC.TabView.design({ 
    value: "welcome", 
    items: [ 
     { title: "Welcome", value: "welcome"}, 
     { title: "splitview", value: "contentView"}, 
    ], 

    itemTitleKey: 'title', 
    itemValueKey: 'value', 

    userDefaultKey: "mainPane" 
})] 
}), 

contentView: SC.SplitView.design({ 
    topLeftView: SC.SourceListView.create({ 
    contentValueKey: 'name', 
    contentBinding: 'Tp.buildingBlockNodesController.content', 
    selectionBinding: 'Tp.buildingBlockNodesController.selection', 
    }), 

    bottomRightView: SC.View.design({ 
     childViews: 'buildingBlockDetails'.w(), 

     buildingBlockDetails: SC.View.design({ 
     layout: { top: 50, left: 50, bottom: 50, right: 50 }, 
     childViews: 'nameLabel'.w(), 

     nameLabel: SC.LabelView.design({ 
     layout: { top: 40, width: 500, height: 18 }, 
     valueBinding: SC.Binding.oneWay('Tp.buildingBlockNodesController.name') 
     }), 
    }) 
    }) 
}), 
welcome: SC.LabelView.design({ 
    escapeHTML: NO, 
    value: "<h1>Sample Tankpit</h1><p>created with SproutCore</p>", 
}), 
}); 

回答

0

我放弃了我的代码通过运行最低限度,并在那一点上我重命名contentView到其他东西,然后突然它的工作。我应该使用App.mainPage.contenView作为变量名称。我想我有一个名字相撞或一些恼人的东西!

,所以我改变:

items: [ 
     { title: "Welcome", value: "welcome"}, 
     { title: "splitview", value: "contentView"}, 
    ], 

items: [ 
      { title: "Welcome", value: "welcome"}, 
      { title: "splitview", value: "App.mainPage.contentView"}, 
     ], 

任何其他名称,然后contenView会工作。