2017-02-17 15 views
0

からコントローラ:Org.Application.summary.view.sample.SampleControllerアクセス私はちょうど私がアクセスしようとしている6</p> <p>コントローラのExtJSを使用して別のコントローラからコントローラのメソッドを呼び出すためにしようとしている別のコントローラのExtJS 6

方法私は別のコントローラからアクセスしようとしました:

var one = Org.Application.app.getController('Org.Application.summary.view.sample.SampleController'); 
var two = this.getApplication().getController('Org.Application.summary.view.sample.SampleController').getOOP(); 
var three = Org.Application.getController('Org.Application.summary.view.sample.SampleController').getOOP(); 

私のメインbuild.gradleファイルにそれはアプリケーション名であるために仮定されている場合、それはproject.ext.set("rtdms.application.name", "Application")わからないを示しています。それぞれのラインのための

エラー:

プロパティを取得することができない未定義またはnull参照の 'getController'

オブジェクトがプロパティまたはメソッドをサポートしない 'getApplication'

オブジェクト」doesnのプロパティまたはメソッド 'getController'をサポートします

答えて

1

探しているコントローラがあなたはそのように見つけることができ、子または親コンポーネント:

this.getView().down('somextype').getController(); 
this.getView().up('somextype').getController(); 

、コンポーネントの参照設定が含まれている場合、それはあなたに装着されているが、ルックアップリファレンスを使用することができます。

this.lookupReference('myreference'); 
関連する問題