我正在尝试将一些值传递给View
中的另一个Controller
。我的代码到目前为止;
success: function (response) {
var text = response.responseText;
if (result.status == "OK") {
Ext.getCmp('mainpanel').push({
title: 'Hello World ',
html: ['<div>', '<b>HELLO PEOPLE</b>: ', '</div>'].join('')
});
}
}
上面的代码在另一个视图中显示html
。
在我的项目结构中,我有一个名为AnotherView.JS
的视图,我需要调用此View
,并将值传递给view
(AnotherView.JS
)。如何修改代码以进行这些更改?
答案 0 :(得分:0)
假设您有两个视图FirstView和SecondView(xtype:'secondview')并且您在FirstViewController中,您需要添加对第二个视图的引用,如下所示:
config: {
refs: {
first: 'firstview',
second:'secondview'
}
}
然后,您可以使用this.getSecond()
获取第二个视图并随意执行任何操作
希望这有帮助