0
我想从嵌套对象内部获取父对象的函数。extJs从嵌套对象访问父函数
Ext.define('SearchPanel', {
extend: 'common.Panel',
header: false,
xtype: 'search-panel',
layout: 'fit',
items: [
{
xtype: 'form-panel',
items: [
{
xtype: 'datetimefield',
itemId: 'from',
fieldLabel: T('From'),
dateConfig: {
itemId: 'startDate',
value: new Date(),
validator: ValidateRange//trying to access "external" function here
},
timeConfig: {
value: '12:00 AM',
itemId: 'startTime',
validator: ValidateRange//trying to access "external" function here
}
}
],
ValidateRange: //the function I'm trying to call from nested object
function (value) {
//validation logic
}
}
],
});
它不起作用。我收到错误:Uncaught ReferenceError:ValidateRange未定义
尝试使用this this.up()。up()。 ValidateRange – 2014-12-02 17:11:05