Skip to content

Instantly share code, notes, and snippets.

@sunvisor
Created June 29, 2012 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunvisor/3016295 to your computer and use it in GitHub Desktop.
Save sunvisor/3016295 to your computer and use it in GitHub Desktop.
Using override config in Ext.define class
/**
* 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