0
所以我有一個如下觀點,即擴展Ext.panel.Panel我可以在Ext JS中動態更改面板的屬性嗎?
Ext.define('SomeView', {
extend: 'Ext.panel.Panel',
alias: 'someview',
title: 'Some View',
closable: true,
initComponent: function() {
this.itemId = 'someView';
this.callParent(arguments);
},
layout: {
type: 'vbox',
align: 'stretch'
},
items: [
{
xtype: 'container',
layout: 'hbox',
items: [
{
xtype: 'container',
itemId: 'someContainer',
tpl: '<h2>{someProperty}</h2>',
flex: 1
},
// other code omitted for brevity
});
我初始化這樣的觀點。
var panel = Ext.create('someview', {
someProperty: 'Some Value'
});
後視圖中示出的是我傳遞給someProperty
被示出,以及該參數。但事情是,我想在顯示視圖後更改someProperty
。我可以這樣做嗎?如果是,如何?我的意思是我可以像這樣改變它
panel.someProperty = 'Some New Value';
但是該視圖不會自動生效。