2017-09-29 5 views
0

ラリーグリッドに関連付けられたデータストアに計算されたフィルタリングを適用する必要があります。ラリーグリッドビューにフィルタを適用する方法

このコードでは、「ノイズ」をデバッグするのに適していますが、設定時にいくつかのフィルタを提供しようとしていますが、無視されたり、フィルタ機能が起動していないようです。

Ext.define('CustomApp', { 
    extend: 'Rally.app.App', 
    componentCls: 'app', 
    launch: function() { 
     //Write app code here 
     console.log("Overall App Launch function entered"); 
     //API Docs: https://help.rallydev.com/apps/2.1/doc/ 
    } 
}); 

Rally.onReady(function() { 
    Ext.define('BOA.AdoptedWork.MultiArtifactGrid', { 
     extend: 'Rally.app.App', 
     componentCls: 'app', 

     launch: function() { 
      console.log("onReady Launch function entered"); 
      this.theGrid = { 
       xtype: 'rallygrid', 
       showPagingToolbar: true, 
       showRowActionsColumn: false, 
       editable: false, 
       columnCfgs: [ 
        'FormattedID', 
        'Name', 
        'ScheduleState', 
        'Iteration', 
        'Release', 
        'PlanEstimate', 
        'TaskEstimateTotal', 
        'TaskActualTotal', // For some reason this does not display ?? :o(?? 
        'TaskRemainingTotal' 
       ], 
       listeners: { 
        afterrender: { 
         fn: function (_myVar, eOpts) { 
          console.log("Arg to afterrender: ", _myVar, " and ", eOpts); 
          console.log("Filters: ", _myVar.filters); 
          var _myStore = _myVar.getStore(); 
          console.log("Store : ", _myStore); 
          console.log("Store filters: ", _myStore.filters); 
         } 
        } 
       }, 
       filters: [{ 
        // This did not work ... 
        property: 'ScheduleState', 
        operator: '==', 
        value: 'Defined', 
        // Trying dynamic Filter Function. Update: Never called. 
        filterFn: function (item) { 
         console.log("Entered Filter Function!"); 
         var iter = item.get("Iteration"); 
         console.log("Iteration field: ", iter); 
         if (iter !== null && iter !== undefined) { 
          return (iter.name === "Sprint 3"); 
         } else { 
          return false; 
         } 
        } 
       }], 
       context: this.getContext(), 
       storeConfig: { 
        models: ['userstory', 'defect'] 
       }, 
       scope: this 
      }; 
      this.add(this.theGrid); 
      console.log("The Grid Object: ", this.theGrid); 
     } 
    }); 


    Rally.launchApp('BOA.AdoptedWork.MultiArtifactGrid', { 
     name: 'Multi-type Grid' 
    }); 
}); 

私は12年前にJavaScriptでコード化していません。だから、私は自分のベアリングを手に入れています。ラリーコミュニティで

+0

コードのスクリーンショットを投稿しないでください。問題を再現するために必要な部分をコピーしてください。 – LW001

+0

コーチングに感謝します。明らかに、私の最初の投稿on stackoverflow.com :) スクリーンショットはすべてのデバッグノイズで混雑していませんでしたが、おそらくあなたは自分自身を理解しようとするために調べていたものを見ることができます。 ありがとうございます。 –

答えて

0

誰かが答え、有用なフィードバックを提供:

corkr03は言った...いくつかのこと@miguelfuerte

: 「フィルター」の設定がstoreConfigの一部である必要があります。上のコードでは、gridConfigの一部です。

storeConfig: { 
     filters: [{ 
      property: "Iteration.Name", 
      value: "Sprint 3" 
     }] 
} 

また、「反復」のプロパティのフィルタでは、反復参照への参照が必要です。その特定の実装では、 "Iteration.Name"というプロパティを使用します。クエリに関するよくある情報とドット表記法の使用方法は次のとおりです。 CA Agile Centralヘルプ

関連する問題