Click the DataGrid pop-up Ldhdialog, click the popup button, close and refresh the DataGrid

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.