2017-05-18 5 views
2

私はアプリケーション内にグリッドを持っています。すべてうまくいく。私は保存された設定から別の列を使用するようにグリッドを変更したい。これはうまく動作します - 私は最初に列のフィルタメニューを開いていない限り。この後、列レイアウトを変更すると、グリッドにフォーカスが再適用されている再構成機能内でエラーが深くなります。 Ext.view.Tableクラスでエラーが発生するコードを次に示します。グリッドの再設定時のエラー

onFocusEnter: function(e) { 
    var me = this, 
     fromComponent = e.fromComponent, 
     navigationModel = me.getNavigationModel(), 
     focusPosition, 
     br = me.bufferedRenderer, 
     focusRecord, focusRowIdx, focusTarget, scroller; 
    // Focusing an internal focusable while TD navigation is disabled; 
    // We do not intervene. 
    if (me.actionableMode) { 
     return; 
    } 
    // The underlying DOM event 
    e = e.event; 
    // We can only focus if there are rows in the row cache to focus *and* records 
    // in the store to back them. Buffered Stores can produce a state where 
    // the view is not cleared on the leading end of a reload operation, but the 
    // store can be empty. 
    if (!me.cellFocused && me.all.getCount() && me.dataSource.getCount()) { 

問題は、me.dataSourceがnullです。私はこの行の直前のコメントがバッファされた店を使用しているときに空の店の潜在的な問題を特定する直前のコメントとしてこれが奇妙だと思っています。

フィルターメニューが最初に表示されない限り、正常に機能するので、再構成機能に有効なストアを提供していることは間違いありません。何か案は?

答えて

0

これをさらに調べて、dataSource値をnullにする理由を調べました。コールスタックの上位には、ストアをバインドするためのExt.util.StoreHolderクラスがあります。これには、ストアをリスナーにバインドしてイベントを発生させ、システムが変更に対応できるようにするコードが含まれます。

bindStore: function(store, initial, propertyName) { 
    ... 
    if (store !== oldStore) { 
     if (oldStore) { 
      ... lines to unbind the old store 
     } 
     if (store) { 
      me[propertyName] = store = Ext.data.StoreManager.lookup(store); 
      me.bindStoreListeners(store); 
      me.onBindStore(store, oldStore); 
     } else { 
      me[propertyName] = null; 

エラーが発生したことをonBindStore内に記録します。ソースからdataSourceを設定する前にコードを追加してエラーが消えました。

実際のExtJsコードを変更しているので、これを行うのは少し気になりません。あなたがより良い答えを考えることができるなら、それを共有してください。

関連する問題