2014-03-03 1 views
1

랠리 용 새 앱을 만들려고합니다. 랠리 SDK와 자바 스크립트를 처음 사용합니다. 첫 번째 집회 앱을 만드는 방법에 대한 자습서를 찾았으며 거기에서 시작했습니다. 그러나 예제를 따르는 중에 오류가 발생합니다. 랠리 샘플 앱 오류

Uncaught TypeError: Cannot call method 'refresh' of undefined 

는 처음에는 내가 뭔가 잘못하고 있던 가정, 그러나 결국 나는 &는 너무 샘플 프로젝트에 무슨 일이 일어나고 발견에서 전체 샘플 애플리케이션을 붙여 복사됩니다.

성공적으로 디버깅하는 올바른 방향으로 나를 가리켜 줄만한 것은 무엇입니까?

내가 (이 예에서) 사용하고 전체 App.js

은 이것이다 :

Ext.define('CustomApp', { 
    extend: 'Rally.app.App', 
    componentCls: 'app', 
    items: { html: '<a href="https://help.rallydev.com/apps/2.0rc2/doc/">App SDK 2.0rc2 Docs</a>' }, 
    launch: function() { 
    this.iterationCombobox = this.add({ 
     xtype: 'rallyiterationcombobox', 
     listeners: { 
     change: this._onIterationComboboxChanged, 
     ready: this._onIterationComboboxLoad, 
     scope: this 
     } 
    }); 
    }, 

    _onIterationComboboxLoad: function() { 
    var addNewConfig = { 
     xtype: 'rallyaddnew', 
     recordTypes: ['User Story', 'Defect'], 
     ignoredRequiredFields: ['Name', 'ScheduleState', 'Project'], 
     showAddWithDetails: false, 
     listeners: { 
     beforecreate: this._onBeforeCreate, 
     scope: this 
     } 
    }; 

    this.addNew = this.add(addNewConfig); 

    var cardBoardConfig = { 
     xtype: 'rallycardboard', 
     types: ['Defect', 'User Story'], 
     attribute: 'ScheduleState', 
     storeConfig: { 
     filters: [this.iterationCombobox.getQueryFromSelected()] 
     } 
    }; 
    this.cardBoard = this.add(cardBoardConfig); 
    }, 

    _onBeforeCreate: function (addNewComponent, record) { 
    record.set('Iteration', this.iterationCombobox.getValue()); 
    }, 

    _onIterationComboboxChanged: function() { 
    var config = { 
     storeConfig: { 
     filters: [this.iterationCombobox.getQueryFromSelected()] 
     } 
    }; 

    this.cardBoard.refresh(config); 
    } 
}); 
+0

샘플 앱의 출처는 어디입니까? 개발자 포털에 있거나 Rally App Builder에 포함되어 있습니까? 샘플을 고쳐야합니다. –

+0

@ KyleMorse, 그 샘플은 개발자 포털에서 왔습니다. https://help.rallydev.com/apps/2.0rc2/doc/#!/guide/first_app – fussmonkey

+0

감사합니다. 정리가 완료되도록하겠습니다. 자습서가 망가 졌을 때 실망 스럽습니다! –

답변

1

대신이 코드를 사용해보십시오. 출처는 this git hub repo입니다.

Ext.define('CustomApp', { 
    extend: 'Rally.app.TimeboxScopedApp', 
    componentCls: 'app', 
    scopeType: 'iteration', 
    onScopeChange: function(scope) { 
     this._iteration = scope.record.get('_ref'); 
     if (!this.down('#addNew')) { 
     var addNewConfig = { 
      xtype: 'rallyaddnew', 
      itemId: 'addNew', 
      recordTypes: ['User Story', 'Defect'], 
      ignoredRequiredFields: ['Name', 'ScheduleState', 'Project'], 
      showAddWithDetails: false, 
      listeners: { 
       beforecreate: this._onBeforeCreate, 
       scope: this 
      } 
     }; 
    } 


     this.addNew = this.add(addNewConfig); 
     if(!this.board) { 
      this.board = this.add({ 
       xtype: 'rallycardboard', 
       storeConfig: { 
        filters: [scope.getQueryFilter()] 
       } 
      }); 
     } else { 
      this.board.refresh({ 
       storeConfig: { 
        filters: [scope.getQueryFilter()] 
       } 
      }); 
     } 
     this.iteration = scope.getRecord(); 
    }, 

    _onBeforeCreate: function(addNewComponent, record) { 
    record.set('Iteration', this._iteration); 
} 
}); 
+0

예, 감사합니다! – fussmonkey