2011-12-13 5 views
4

패널이 생성 된 후에 나는 dockedItem 도구 모음을 만들려면 :의 ExtJS 4 추가 도구 모음 실행 시간 dockeditems

Ext.onReady(function() { 
    Ext.create('Ext.container.Viewport', { 
     layout: 'border', 
     items: [{ 
      region: 'center', 
      xtype: 'panel', 
      listeners: { 
       afterrender: function(panel) { 
        //Below gives: Uncaught TypeError: Object #<Object> has no method 'getItemId' 
        panel.dockedItems.add({ 
         xtype: 'toolbar', 
         dock: 'bottom', 
         items: [{ 
          text: 'adfsadf' 
         }] 
        }); 
       } 
      } 
     }, { 
      region: 'west', 
      title: 'west', 
      html: 'west', 
      width: 120 
     }, { 
      region: 'east', 
      title: 'east', 
      html: 'east', 
      width: 120 
     }, { 
      region: 'north', 
      html: 'north', 
      title: 'north', 
      height: 60 
     }, { 
      region: 'south', 
      html: 'south', 
      title: 'south', 
      height: 60 
     }] 
    }); 
}); 

오류는 다음과 같습니다

Uncaught TypeError: Object #<Object> has no method 'getItemId' 

모든 아이디어에 방법 이 작업을 수행?

답변

9

마음은 생각보다 간단했습니다.

솔루션 :

panel.addDocked({ ... });