Overwrite Ext Direct callback or something?

128 Views Asked by At

I have many Ext Direct call, and I need to show a Message Box after the result arrived.

Direct.Class.Function (params, function (result) {
   // need to show message box in many ajax result like this

   //...
})

Is there any solution to this? Can I overwrite or make a default callback before unique callback somehow?

1

There are 1 best solutions below

0
On

I found it! :)

Ext.direct.Manager.on('message', function(e){
    Ext.Msg.show({
        title: "Message",
        msg: e.text, 
        buttons: Ext.Msg.OK, 
        icon: Ext.Msg.INFO, 
        fn: function (btn) { 
            location.href = e.url;
        },
        scope: this 
    });
});