Created
June 29, 2012 06:40
-
-
Save sunvisor/3016295 to your computer and use it in GitHub Desktop.
Using override config in Ext.define class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Using override config in Ext.define class (Ext JS 4.1) | |
*/ | |
Ext.onReady(function () { | |
Ext.define('MyWindow', { | |
extend: 'Ext.window.Window', | |
width: 300, | |
height: 200, | |
title: 'test', | |
fbar: { | |
items: [ | |
{ | |
text:'OK', | |
handler: function(btn) { | |
this.up('window').onOk(); | |
} | |
} | |
] | |
}, | |
onOk: function() { | |
console.log('MyWindow!'); | |
} | |
}); | |
Ext.define(null, { | |
override: 'MyWindow', | |
width: 300, | |
title: 'Overrided', | |
onOk: function () { | |
this.callParent(arguments); | |
console.log('overrided!!'); | |
} | |
}); | |
Ext.create('MyWindow').show(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment