jeecg中自定义dialog,实现窗体的弹出
自定一个dialog,在子窗体中写一个方法,然后通过iframe进行调取
function createwindowoktext(title, addurl,width,height,oktext,canceltext) {
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; }
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;
var orgIds=iframe.getDomianIds();
var orgNames = iframe.getDomian(); //alert(orgId);
$("input[name='domainIdStr']").attr("value",orgIds);
$("input[name='domainStrs']").attr("value",orgNames);
//saveObj();
return true; }
,
okVal:oktext,
cancelVal: canceltext,
cancel: true /为true等价于function(){}/
}).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; var orgIds=iframe.getDomianIds(); var orgNames = iframe.getDomian(); //alert(orgId); $("input[name='domainIdStr']").attr("value",orgIds); $("input[name='domainStrs']").attr("value",orgNames); //saveObj(); return true; }
,
okVal:oktext,
cancelVal: canceltext,
cancel: true /为true等价于function(){}/
}).zindex();
}
}