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