2012-03-22 7 views
1

私は、このhttp://dev.sencha.com/deploy/ext-4.0.7-gpl/examples/portal/portal.htmlのようなポータルレイアウトのタブを持つウィンドウを構築しようとしています。ウインドウ、トップバー、フッタ、ラベル、コンボボックス、チャートはすべて表示されますが、タブをウィンドウに置くと表示されません。以下は私のコードextJSタブがポータルレイアウトに表示されない

//portal.js that is calling 
Ext.define('Ext.app.Portal', { 

extend: 'Ext.container.Viewport', 

uses: ['Ext.app.PortalPanel', 'Ext.app.PortalColumn', 'Ext.app.RegHosts', 'Ext.app.ChartPortlet', 'Ext.app.RougeHosts'], 

getTools: function(){ 
    return [{ 
     xtype: 'tool', 
     type: 'gear', 
     handler: function(e, target, panelHeader, tool){ 
      var portlet = panelHeader.ownerCt; 
      portlet.setLoading('Working...'); 
      Ext.defer(function() { 
       portlet.setLoading(false); 
      }, 2000); 
     } 
    }]; 
}, 

initComponent: function(){ 
    var content = '<div class="portlet-content">'+Ext.example.shortBogusMarkup+'</div>'; 

    Ext.apply(this, { 
     id: 'app-viewport', 
     layout: { 
      type: 'border', 
      padding: '0 5 5 5' // pad the layout from the window edges 
     }, 

     items: [{ 
      id: 'app-header-complete', 
      xtype: 'box', 
      region: 'north', 
      height: 40, 
      html: '' 
     },{ 
      xtype: 'container', 
      region: 'center', 
      layout: 'border', 
      items: [{ 
       id: 'app-portal', 
       xtype: 'portalpanel', 
       region: 'center', 
       items: [{ 
        id: 'col-1', 
        items: [{ 
         id: 'regehosts', 

         title: 'Registered Hosts', 
         tools: this.getTools(), 
         items: Ext.create('Ext.app.RegeHosts'), 
         listeners: { 
          'close': Ext.bind(this.onPortletClose, this) 
         } 
        }] 
       },{ 
        id: 'col-2', 
        items: [{ 
         id: 'rouge', 
         title: 'Rouge Hosts', 
         tools: this.getTools(), 
         items: Ext.create('Ext.app.Rouge'), 
         listeners: { 
          'close': Ext.bind(this.onPortletClose, this) 
         } 
        }] 
       }, 
       { 
        id: 'col-3', 
        items: [{ 
         id: 'devices', 
         title: 'Devices', 
         tools: this.getTools(), 
         items: Ext.create('Ext.app.Devices'), 
         listeners: { 
          'close': Ext.bind(this.onPortletClose, this) 
         } 
        }] 
       } 
       ] 
      }] 
     }] 
    }); 
    this.callParent(arguments); 
}, 

onPortletClose: function(portlet) { 
    this.showMsg('"' + portlet.title + '" was removed'); 
}, 

showMsg: function(msg) { 
    var el = Ext.get('app-msg'), 
     msgId = Ext.id(); 

    this.msgId = msgId; 
    el.update(msg).show(); 

    Ext.defer(this.clearMsg, 3000, this, [msgId]); 
}, 

clearMsg: function(msgId) { 
    if (msgId === this.msgId) { 
     Ext.get('app-msg').hide(); 
    } 
} 
}); 













    // function contents that is called 

requires:["*"], 



    ,initComponent:function() 
    {Ext.apply(this,{layout: { 
     type: 'fit' 
    } 
    ,width:550,height:420,items: 
    [ 

    {xtype:"label",fieldLabel: text, name:'txt',text:text,  
     id:'devicesLabel',style:'width:300px;'}, 

{ 
xtype:'tabpanel', 
width: 400, 
    height: 400, 

    items: [{ 
    title: 'Foo' 
    }, { 
    title: 'Bar', 
    tabConfig: { 
     title: 'Custom Title', 
     tooltip: 'A button tooltip' 
    } 
    }] 

} 



    ] 


    });this.callParent(arguments)}}); 
+0

人があなたに手伝ってもらうためには、少なくともコードを書式設定して読めるようにする必要があります。 –

+0

@EvanTrimboliご迷惑をおかけします。お詫び申し上げます。しかし、私は今それをやった。 – dev

+0

ヘルプを待っています – dev

答えて

0

は、私はあなたがフィットレイアウトのドキュメントを読むことをお勧めしたいですが、それが動作しない理由は、最初の行にある:あなたはレイアウトのいくつかの他の種類を使用する必要がhttp://docs.sencha.com/ext-js/4-0/#!/api/Ext.layout.container.Fit

例えば、それらを並べて表示させるには、hboxを使います。お互いの上に、vboxを使用します。他にもいくつかのレイアウトがあり、レイアウトブラウザの例でその例を見ることができます。

+1

というラベルとタブパネルを持っていますが、結果は得られません。最初のタブの内容が表示されていますが、ツールバーは表示されません。私は、firebugのhtmlタブで自分のタブのタイトルを見つけようとしましたが、どちらもロードされていません.1つのタブのタイトルでさえもレンダリングされませんでした。また、activetab:0を設定した場合、2番目のタブの内容が読み込まれない(htmlのfirebugで取得されます)。アクティブなタブを設定した場合:1両方のタブの内容はロードされますが、ツールバーとタイトルは表示されません。また、私は私のページ内のext-debug-allを含むレコードをconsole.Forで表示しています。あなたの助けを待っている – dev

+0

これは非常に古い話題ですが、私は最近同じ問題を抱えています。まったく同じ問題です。(私はこのウェブサイト、賢者フォーラムなどでさまよっていますが、答えは得られませんでした..誰かが答えを知っているなら、答えを共有してください..:|私はTABSを表示する必要があります....ありがとう:) –

関連する問題