我從我的觀點調用兩次控制器函數。出於某種原因,其中一個電話正在工作,而另一個則不在。我對ExtJS相對來說比較新,所以請大家幫忙。列舉者之間的ExtJS範圍
Ext.define('Gsm.view.systemmessages.SystemMessages', {
extend: 'Ext.grid.Panel',
...
...
...
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
xtype: 'textfield',
name: 'searchfield',
cls: 'searchfield',
listeners: {
change: function(field, value){
this.getController().filterStore(value); <-- can not reach controller from here
}
}
}]
}],
columns: [{
text: 'Tipas',
width: 150,
dataIndex: 'type',
sortable: true
},
...
...
...
{
...
...
...
}],
listeners: {
select: function(RowModel, record, index, eOpts){
this.getController().onRowClick(record); <-- can reach controller from here
}
}
});
分享你的控制器代碼會很有幫助 – lascort
但是控制器與它沒有關係嗎?我的意思是我甚至不能調用控制器,我得到「this.getController()爲null」與dockItem監聽器 – CrazySabbath