javascript - Repostion Ext.MessageBox.alert() without changing the current code -


i want ext.messagebox.alert() across application , set new position. have many jsp pages in our application, in have used ext.messagebox.alert(), requirement reposition message boxes, without touching code in jsp..i can include js file though

option 1: found able reposition message alert by: https://stackoverflow.com/questions/1...l-align-with-y have change jsp pages , add:

msgbox=ext.messagebox.alert(jsondata.responsemessage); msgbox.getpositionel().settop(50); 

option 2: extend message box : still change jsp

option 3: use css : dont know how?

can please guide me if there anyother solution or css solution fine:

my code below

    ext.ajax.request({                         url : 'submitaddzone.htm',                         params : {                                                 zonename : ext.getcmp('zonenameid').getvalue(),                                                 emailparam : ext.getcmp('emailid').getvalue(),                                                 requesttypeparam : ext.getcmp('requesttypeid').getvalue(),                                                 level : selectedlevel + 1,                                                 parentzonename : selectedparentzone,                                                 currency : currencyvalue,                                                 startdate : ext.getcmp('startdateid').getvalue(),                                                 starttime : ext.getcmp('starttimeid').getvalue()                                             },                                             method : 'post',                                              success : function(response,request) {                                                 toggleaddzoneelements();                                                         var jsondata = ext.decode(response.responsetext);                                                        if(jsondata.issuccess){                                                        msgbox=   ext.messagebox.alert(jsondata.responsemessage);                                                      msgbox.getpositionel().settop(50);                                                         addzonewin.close();                                                        toggleaddzonebuttons();                                                        tree.getstore().load({url: 'loadcustomerstructure.htm'});                                                        }else{                                                        ext.getcmp('sendrequest').seticon();                                                        ext.getcmp('errormessage1').settext(encoder.htmldecode(jsondata.errormessage));                                                        ext.getcmp('errormessage1').show();                                                        }                                             },                                             failure : function(                                                     response) {                                                 toggleaddzoneelements();                                                 msgbox= ext.messagebox.alert(notcreatedlabel);                                                 addzonewin.close();                                                 msgbox.getpositionel().settop(50);                                             }                                          }); 

a clean solution create own messagebox class offers custom alert method, in call ext.messagebox.alert() , change position. require change jsp files.

now gets dirty: can try override ext.messagebox.alert:

ext.override(ext.messagebox,{     alert: function(message){          var msgbox = ext.messagebox.alert(message);          msgbox.getpositionel().settop(50);     } }); 

but affects calls ext.messagebox.alert(). not have such hack in code.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -