我想要跨應用程序獲取所有Ext.MessageBox.alert()並將其設置爲新位置。 我們在我們的應用程序中有很多jsp頁面,其中我們使用了Ext.MessageBox.alert(),現在需要重新定位所有的消息框,而不用在jsp中觸摸它們的代碼..我可以包含一個js文件,儘管Repostion Ext.MessageBox.alert()而不更改當前代碼
選項1: 我發現我能夠通過重新定位一個信息提示:https://stackoverflow.com/questions/1...l-align-with-y 但後來我不得不改變所有的JSP網頁,並添加:
msgBox=Ext.MessageBox.alert(jsonData.responseMessage);
msgBox.getPositionEl().setTop(50);
選項2:延長的消息框:仍然改變一切jsp
選項3:使用css:不知道如何?
任何人都可以請指導我,如果有任何其它的解決方案或CSS的解決方案將被罰款:
我的代碼如下
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);
}
});
到選項1中的stackoverflow問題的鏈接指向無效。 – Christoph