我有一個應用程序,在選項卡窗格中的每個選項卡後面都有一個extJS網格。ExtJS面板有時會凍結
(也許截圖將有助於可視化):
我們的主要應用是我們自己定製編寫的JavaScript應用程序,我們只是增加了一些ExtJS的組件(在這種情況下,網格組件)。
每隔一段時間,表格就會凍結(但是像滾動窗格和文本框這樣的本地功能不會凍結)。這隻發生在我們點擊標籤之間時。這是非常隨機的,並且控制檯中沒有錯誤消息,但是我通常在選項卡之間單擊約4-5次後進行凍結,並執行幾次網格排序,並且可能會更改列順序幾次。即。我做的越多,我越有可能得到這個凍結,但是我還沒有確定一個模式。
最初我以爲我配置網格的方式出了問題,但它似乎是在面板級別(而不是網格級別)。
也許我設置網格的方式不正確。這是我創建我的網格和'呈現'到一個DIV的代碼:
/**
* onActive method for a Page. When the page is displayed this is first called.
*
* A null check needs to be done first to determine whether the component is created.
*
*/
onActive : function() {
var pageDivs = Ext.select('div .Page');
var paveDIV = pageDivs.elements[0];
if (!this.tablePanel) {
Util.logInfo("creating new table panel")
//create component
this.tablePanel = this.createTablePanel();
//add it to the DIV
this.tablePanel.render(paveDIV);
//load data
this.loadPackageAllData();
}
this.tablePanel.doLayout();
this.tablePanel.getView().refresh();
},
createTablePanel : function() {
var _self = this;
this.packageGrid = Ext.create('js.grid.PackageGrid', {
width: '979px',
height: '400px',
layout: 'fit',
margin: '5px',
flex: 1,
listeners: {
itemdblclick : function(selModel, record, index, options){
_self.showDetailView(record.data.id);
}
},
aditionalToolbarItems: _self.aditionalToolbarItems
});
return this.packageGrid;
},
這是一種惰性加載 - 即。如果它已經創建,那麼只需使用舊的參考。
- 是我的使用渲染是否正確?
- 有沒有更好的模式,我可以使用?
- 執行doLayout()和refesh()切換標籤頁後將是正確的事情嗎?
我希望對我的觀點之一的回答將清除爲什麼我偶爾會凍結我的屏幕。