splitview未从tabview菜单加载

时间:2011-05-24 14:12:01

标签: sproutcore

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

我正在使用最新的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>",
}), 
});

1 个答案:

答案 0 :(得分: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将有效。

相关问题