2016-08-05 17 views
0

私はPartKeepr(v0.1.9)というオープンソースプログラムを編集しようとしています。プログラムの特定の部分では、新しいExt.window.Windowを開くボタンを追加したいと思います。私のコードはうまくいきません(私はextjsでかなり新しいですが、私は推測することが困難な仕事をしているので、学習を始める場所についてのアドバイスはすべて公開しています。 )は、既存のコードから、利用可能なコードの類似の部分を見ることによって、いくつかのものを適用Extjsボタンをクリックして新しいExt.window.Windowを開く

Ext.define('PartKeepr.FindWindow',{ 
    extend:'Ext.window.Window', 
    constrainHeader: true, 
    title: i18n("Find Number"), 
    initComponent: function() { 
    this.okButton=Ext.create("Ext.button.Button",{ 
    text:i18n("OK")}); 
    this.buttons=[this.okButton]; 
    } 
}); 
{ 
    xtype: 'button', 
    text: i18n("Find"), 
    name: 'findButton', 
    handler: Ext.bind(this.findNumber, this) 
} 
findNumber: function(){ 
    var j = new PartKeepr.FindWindow(); 
    j.show(); 
} 

編集:EXT-all.js:私は私の次のエラーを与えて検索ボタン、コンソールを押します。 21 Uncaught TypeError:未定義の 'insert'プロパティを読み取ることができません

答えて

0

スーパークラスのinitComponentメソッドを呼び出す必要があります。

Ext.define('PartKeepr.FindWindow', { 
    extend: 'Ext.window.Window', 
    constrainHeader: true, 
    title: i18n("Find Number"), 
    initComponent: function() { 
     this.okButton = Ext.create("Ext.button.Button", { 
      text: i18n("OK") 
     }); 
     this.buttons = [this.okButton]; 
     this.callParent(); 
    } 
}); 
関連する問題