コード付きのactioncolumnアイコンをクリックして、ExtJS4でウィンドウを作成しています。
{
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:'destroy'」があります:
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'),
},
});
ご覧のとおり、Windowはエイリアス名「widget.ba」で呼び出されます。
したがって、actioncolumnアイコンを初めてクリックすると、すべてがうまくいきますが、そのウィンドウを閉じて(ウィンドウの右上にある「十字」を閉じるをクリックして)、actioncolumnアイコンをもう一度クリックすると、「Uncaught TypeError:Cannotreadproperty」が表示されます。コンソールログの「未定義のスタイル」で、「ba.show();」にスローされます。スクリプトの行。ウィンドウは表示されていませんが、アイコンウィンドウをもう一度クリックするとレンダリングされますが、実際にはウィンドウではなく、ビューポートへの単純なパネルとしてレンダリングされます。
「closeAction」が「destroy」に設定されている場合、なぜそのような問題が発生するのでしょうか。
ありがとう。