2017-07-30 9 views
0

名前でフィルタリングされたすべてのPortfolioItem/Featureをリストしたコンボボックスを作成したい。ここに私のコードですラリーコンボボックスがクリックで機能しない

 Ext.define('Rally.Dashboard', { 
      extend: 'Rally.app.App', 
      launch: function() { 
       if (this.down('#features')) { 
        this.down('#features').destroy(); 
       } 

       var features = Ext.create('Rally.ui.combobox.ComboBox', { 
        itemId: 'features', 
        allowNoEntry: false, 
        storeConfig: { 
         model: 'PortfolioItem/Feature', 
         fetch: ['FormattedID', 'Name', 'ObjectID', 'UserStories'], 
         autoSelect: true, 
         pageSize: 100, 
         autoLoad: true, 
         filters: [this._getFilter()] 
        }, 
        fieldLabel: 'Select Feature', 
        listeners: { 
         ready: function (combobox) { 
          if (combobox.getRecord()) { 
           this._onFeatureSelected(combobox.getRecord()); 
          } 
         }, 
         select: function (combobox) { 
          if (combobox.getRecord()) { 
           this._onFeatureSelected(combobox.getRecord()); 
          } 

         }, 
         scope: this 
        } 
       }); 
       this.add(features); 

      }, 
      _onFeatureSelected: function (feature) { 

       console.log('feature', feature.get('Name')); 


      },//_onFeatureSelected 

      _getFilter: function() 
      { 
       return { 
        property: 'Name', 
        operator: 'Contains', 
        value: 'Feature' 
       } 
      } 

     }); 
     Rally.launchApp('Rally.Dashboard', { 
      name: 'example' 
     }); 

初めてダッシュボードを読み込むときは、すべて正常に動作します。コンボボックスをクリックすると、コンボボックスがクリーンアップされ、ログにレスポンスエラーが表示されます。

"QueryResult":{"エラー:"解析できませんでした:属性を見つけられませんでした\ "_ refObjectName \ "0、" StartIndex ":0、" PageSize ":0、" Results ":[]}}

答えて

0

ああ、コンボボックス。残念ながら、このコンポーネントは、製品全体で多くのさまざまな用途があり、互換性のないいくつかのExtJSアップグレードが経時的に行われているため、荒い寿命がありました。

私はそれが(先行入力検索を含む)すごみの束を扱うと思うように私はあなたのために、代わりに使用してお勧めしたい、本当に素敵なアーティファクトの検索コンボボックスがあります:

var features = Ext.create('Rally.ui.combobox.ArtifactSearchComboBox', { 
    itemId: 'features', 
    allowNoEntry: false, 
    storeConfig: { 
     models: ['PortfolioItem/Feature'], 
     fetch: ['FormattedID', 'Name', 'ObjectID', 'UserStories'], 
     pageSize: 100, 
     autoLoad: true // or false if you want to wait to load until click 
    }, 
    fieldLabel: 'Select Feature', 
    listeners: { 
     ready: function (combobox) { 
      if (combobox.getRecord()) { 
       this._onFeatureSelected(combobox.getRecord()); 
      } 
     }, 
     select: function (combobox) { 
      if (combobox.getRecord()) { 
       this._onFeatureSelected(combobox.getRecord()); 
      } 
     }, 
     scope: this 
    } 
}); 
関連する問題