Premise main Window page using EXT, pop-up windows using jquery Effect requirements: Pop-up windows automatically close the window after the commit action has finished executing
Specific code implementation (home page EXT code)
function Displaycurrenttaskform (taskuuid) {
Ext.Ajax.request ({
URL: ' <%=rootpath%>/displaycurrenttaskform.action ',
Params: {
Taskinstanceuuid:taskuuid,
Username:username
},
Success:function (response, options) {
var htmlstr= "<iframe src= ' <%=rootpath%>/view/xxx.jsp?taskinstanceuuid=" +taskuuid+ "&action=" Xxx.action ' id= ' Frameid ' name= ' Frameid ' width= ' 100% ' height= ' 100% ' ' 0 ' frameborder= ' no ' ></iframe> ";
var dialoghandler = new Ext.window ({
ID: ' ShowWindow ',
Title: ',
Frame:true,
width:800,
HEIGHT:450,
Layout: ' Fit ',
Modal:true,
Items: [{
height:390,
Autoscroll:true,
Border:false,
Name: ',
ID: ',
Html:htmlstr
} ]
});
Dialoghandler.on (' Close ', function () {/* Refresh record * *
var gridpanel = ext.getcmp (' Xxxxxpanel ');
Gridpanel.getstore (). reload ();
});
Dialoghandler.show ();
}
});
}
Pop-up window
var action= "<%=request.getparameter" ("Action")%> ";
var options = {
Target: ' #MyResult ',
URL: ' <%=rootpath%>/' +action,
Type: ' Post ',
Beforesubmit:showrequest,
Success:showresponse,
DataType: ' JSON ',
timeout:3000
};
$ (document). Ready (
function ()
{
$ (' #diplayTaskForm '). Submit (function () {
$ (this). Ajaxsubmit (options);
return false;
});
}
);
function Showrequest (FormData, Jqform, options) {
return true;
}
function Showresponse (responsetext, StatusText, XHR, $form) {
if (responsetext== "success") {
var xshadow=$ (". X-shadow", window.parent.document);
var mask=$ (". Ext-el-mask", window.parent.document);
var p=$ (' #showWindow ', window.parent.document);
Mask.remove ();
Xshadow.remove ();
P.remove ();
}
}
Method Two
Set a global variable in the parent window
var Popwindow;
popwindow= New Ext.window ({
ID: ' ShowWindow ',
Title: ' <div align= ' center ' style= ' bgcolor:blue ' >process Start [' +name+ ']</div> ',
width:600,
Frame:true,
HEIGHT:450,
Layout: ' Fit ',
Modal:true,
Items: [{height:390,autoscroll:true,border:false,name: ', id: ', items:form1}]
});
Popwindow.show ();
function Showresponse (responsetext, StatusText, XHR, $form) {
Controlsubmit (FALSE);
if (responsetext== "success") {
/*
var xshadow=$ (". X-shadow", window.parent.document);
var mask=$ (". Ext-el-mask", window.parent.document);
var p=$ (' #showWindow ', window.parent.document);
Mask.remove ();
Xshadow.remove ();
P.remove ();
*/
Window.parent.popWindow.close ();
}
} else {
Alert ("Fail" +responsetext);
}
}