0

摘自 json 文件...

{
"items": [
    {
        "xtype": "tabbarcontext",
        "ptype": "tabbarcontext",
        "pstype": "maintab",
        "activeTab": 0,
        //"title": "NotTitleConfig",
        "config": [
            {"title": "TitleConfig"}
        ],
        "items": [
            {
                "xtype": "panel",
                "ptype": "tab",
                "layout": {
                    "type": "border"
                },

当这个 json 被戳到视口中时......

 Ext.apply(me, {
        // we are adding TabBar with 4 tabs to Viewport
        items:  appItems // json retrieved from store

选项卡面板已创建,activeTab = 0,但 config: 尚未设置标题。在 json 文件中注释代码 "title": "NotTitleConfig" 确实设置了选项卡标题。为什么是这样?蒂亚。

4

1 回答 1

0

配置应该是 JavaScript 对象而不是 JSON 字符串。以下应该工作

Ext.apply(me, { items: Ext.JSON.decode(appItems) });
于 2013-01-30T07:35:17.463 回答