The JS in the DataGrid says so.
Click the Add button to trigger
function Superadd (title,addurl,gname,width,height) {
Gridname=gname;
CreateWindow (title, addurl,width,height);
}
Click the Modify button to trigger
function Superupdate (Title,url, id,width,height,isrestful) {
Gridname=id;
var rowsdata = $ (' # ' +id). DataGrid (' Getselections ');
if (!rowsdata | | rowsdata.length==0) {
Tip (' Please select Edit Item ');
Return
}
if (rowsdata.length>1) {
Tip (' Please select a record and edit ');
Return
}
if (isrestful!= ' undefined ' &&isrestful) {
URL + = '/' +rowsdata[0].id;
}else{
URL + = ' &id= ' +rowsdata[0].id;
}
CreateWindow (Title,url,width,height);
}
Write a Ldhdialog
function CreateWindow (title, addurl,width,height) {
width = width?width:700;
Height = height?height:400;
if (width== "100%" | | height== "100%") {
width = window.top.document.body.offsetWidth;
Height =window.top.document.body.offsetheight-100;
}
--author:jueyue---------date:20140427---------for: Popup Bug Modified, ZIndex () function set
if (typeof (WINDOWAPI) = = ' undefined ') {
$.dialog ({
Content: ' URL: ' +addurl,
Lock:true,
zindex:1990,
Width:width,
Height:height,
Title:title,
opacity:0.3,
Cache:false,
Ok:function () {
iframe = This.iframe.contentWindow;
Saveobj ();
return false;
},
Cancelval: ' Off ',
Cancel:true,/* is true equivalent to function () {}*/
button:[{
Name: ' Initiate ',
Focus:true,
Callback:function () {
iframe = This.iframe.contentWindow;
Faqi (); Call this method
return false;
}
}]
}). ZIndex ();
}else{
W.$.dialog ({
Content: ' URL: ' +addurl,
Lock:true,
Width:width,
zindex:1990,
Height:height,
Parent:windowapi,
Title:title,
opacity:0.3,
Cache:false,
Ok:function () {
iframe = This.iframe.contentWindow;
Saveobj ();
return false;
},
Cancelval: ' Off ',
Cancel:true,/* is true equivalent to function () {}*/
Buttons: [{
Text: ' Ok ',
Iconcls: ' Icon-ok ',
Handler:function () {
Alert (' OK ');
}
}, {
Text: ' Cancel ',
Iconcls: ' Icon-cancel ',
Handler:function () {
$ (' #dlg '). Dialog (' Close ');
}
}]
}). ZIndex ();
}
}
function Faqi () {
$ (' #faqi ', iframe.document). Click (); Faqi is a <a> ID on the Add and edit page, which triggers the onclick () in the edit page
Window.f_load ();//Refresh parent page DataGrid
}
function F_load () {
$ (' #tPdmisExceptionList '). DataGrid (' reload ');
}
Edit Page JSP
<a class= "Easyui-linkbutton l-btn" id= "Faqi" onclick= "Faqi ()" > Initiating </a>
function Faqi () {
$.ajax ({
Cache:true,
Type: "POST",
URL: ' Tpdmisexceptioncontroller.do?faqi ',
data:$ (' #formobj '). Serialize (),
Async:false,
Error:function (Request) {
Tip ("Failed to initiate");
},
Success:function (Result) {
FrameElement.api.reload (FRAMEELEMENT.LHGDG); Back to Faqi () in JS on the DataGrid page
alert (result.msg);
FrameElement.api.close (); Close the Popup Box dialog
},
DataType: ' JSON '
});
}
Click the DataGrid pop-up Ldhdialog, click the popup button, close and refresh the DataGrid