次のコードが機能しないのはなぜですか (ExtJS V6)?
Ext.define('Test', {
extend: 'Ext.window.Window',
xtype: 'basic-window',
config: {
mytitle: ''
},
constructor: function (config) {
Ext.apply(this, config);
this.callParent(config);
},
requires: [
'Ext.form.Panel'
],
height: 300,
width: 400,
scope: this,
title: 'title: ' + this.mytitle,
autoScroll: true,
autoShow: true,
bodyPadding: 10,
html: "Lorem ipsum",
constrain: true,
});
var t = Ext.create('Test', {mytitle: 'testtitle'});
t.show();
これにより、ウィンドウのタイトルが「タイトル:testtitle」に設定されると思います。代わりに、タイトルを「title: undefined」に設定します。
アドオン: 使用する場合
...
title: 'title' + this.getMytitle(),
...
「Uncaught TypeError: this.getMytitle は関数ではありません」というメッセージが表示されます。なんで?