2011-12-16 14 views

答えて

1

このシナリオを試してみてください。

SenderView:

initComponent: function() { 

var foo = 'bar'; 
// call to parent initComponent.... 

this.query('#buttonID')[0].on({ 
    scope: this, 
    tap: function (ct) { 
    Ext.dispatch({ 
     controller: 'MyController', 
     action: 'myaction', 
     foo: foo 
    }) 
    } 
}) 
} 

MyController:

myaction : function (options) { 
    var foo = options.foo; 
    this.render ({ 
    xtype: 'myview', 
    foo: foo 
    }) 

} 

MYVIEW:

initComponent: function() { 
    var config = this.initialConfig, 
    // hopla! foo is transmitted from SenderView to the MyView 
    foo = config.foo; 
    ... 
    console.log(foo) ; // bar 
} 

、コードは実際にテストされていませんが、考え方は明確です私は願います :)

オレグ

関連する問題