2012-04-17 80 views
0

我通過點擊圖標actioncolumn創建與ExtJS的4一個窗口代碼:窗口closeAction錯誤

{ 
     xtype:'actioncolumn', 
     width: 20, 
     items: [ 
      { 
       tooltip: 'Log', 
       icon: '/img/details.gif', 
       handler: function(grid, rowIndex) { 

        var store = grid.getStore(); 

        var record = store.getAt(rowIndex); 

        var ba = Ext.createByAlias('widget.ba'); 

        ba.setTitle(ba.title + record.get('name')); 

        ba.down('grid').getStore().load({ 
         params:{ 
          id: record.get('id'), 
         }, 
        }); 

        ba.show(); 

       }, 

      }, 
     ] 
    }, 

我的窗口中有 「closeAction: '摧毀'」:

Ext.define('BB.view.Ba', { 

    extend: 'Ext.window.Window', 
    alias: 'widget.ba', 
    title: 'Log ', 
    layout: 'fit', 
    width: 500, 
    closeAction: 'destroy', 
    items: { 
      xtype: 'gridpanel', 
      store: 'Bas', 
      selType: 'rowmodel', 
      columns: [ 
       { 
        dataIndex: 'order_id', 
        width: 60, 
        text: 'order id', 
       }, { 
        dataIndex: 'time', 
        width: 100, 
        text: 'time', 
       }, { 
        dataIndex: 'summ', 
        width: 80, 
        text: 'summ', 
        renderer: function(value) { 
         return value.toFixed(2); 
        }, 
       }, { 
        dataIndex: 'comment', 
        width: 220, 
        text: 'comment', 
       }, 
      ], 
      //bbar: Ext.createByAlias('widget.paging'),   

     }, 



}); 

,你可以請參閱窗口由別名'widget.ba'調用。因此,當我第一次單擊actioncolumn圖標時,永久繼續順利進行,但是如果關閉該窗口(單擊窗口右上角的「cross」)並再次單擊actioncolumn圖標,我會看到「Uncaught TypeError:在控制檯日誌中無法讀取屬性'undefined'的樣式,並且它被拋出「ba.show();」腳本的行。窗口不顯示,但在其他點擊圖標窗口渲染後,但它不是一個實際上是一個窗口,它被渲染爲視口的簡單面板。

爲什麼如果「closeAction」設置爲「銷燬」,那麼存在這樣的問題?

謝謝。

回答

0

我發現了這個問題。窗口在視口中呈現,因爲非常長的網格將Viewport的底部向下移動。