0
votes

I want to create an override for the Ext.MessageBox. I have created the override file manually and pointed a JS resource to it. Now Architect sees this file as an override. But when calling the override function I get an error. If I look throught the Ext.MessageBox object the new function is not there. How can I specify overrides in Architect? What excactly am I doing Wrong?

/app/overrides/MessageBox.js

Ext.define('myapp.override.MessageBox', {
    override: 'Ext.MessageBox',

    test: function(){
        alert("123");
}

}); 

calling: Ext.MessageBox.test();

gives: Uncaught TypeError: Object [object Object] has no method 'test'

1

1 Answers

0
votes

MessageBox is a singleton which you cannot override in this way.

You can add things to MessageBox in code like so:

Ext.MessageBox.test = function() { alert('123'); });