2014-01-12 28 views
0

我有一個名爲container maincontainer其中有三個組成部分不能訪問父的子組件內的控制器

  1. 按鈕(whose id is mainBtn)
  2. 文本框
  3. 文本框

現在,當我嘗試訪問子組件mainBtnmaincontainersetText動態我得到01對象setText上的方法未定義。

這意味着我的控制器內的代碼無法訪問子組件。

這裏我已經嘗試過,但沒有他們正在工作,我訪問使用控制器中的引用。 mymaincontainer : 'maincontainer'

this.getMyMainContainer().getComponent('mainBtn'); -- undefined 

    this.getMyMainContainer().down('#mainBtn'); -- null 

    this.getMyMainContainer().getItems()[0] -- undefined 
+0

試 「this.getMymaincontainer()getComponent( 'mainBtn');」 – Viswa

回答

0

嘗試:

this.getMyMainContainer().getComponent().getItems().get('mainBtn'); 
+0

沒了,這是不工作 – Hunt