我在下面的代码中收到“未捕获的 ReferenceError:searchPerson 未定义”。
如何从“onTriggerClick”事件处理程序中调用“searchPerson”?
Ext.define('App.view.search.Base', {
extend: 'Ext.window.Window',
layout: 'vbox',
items:[
{
xtype: 'container',
height:30,
layout: 'hbox',
width: '100%',
items: [
comboChoice= Ext.create('Ext.form.ComboBox', {
width: 150,
padding: '0 20 0 0'
}),
edPerson= Ext.create('Ext.form.field.Trigger', {
triggerCls: 'x-form-search-trigger',
flex: 1,
onTriggerClick: function() {
**searchPerson(); //it does not work this way**
}
})
]
},
{
xtype: 'grid',
flex: 1,
width: '100%',
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
]
}
],
searchPerson: function() {
alert('done!');
}
});