showModalDialog 使用

 

 

例子一:

父页面:

function queryList(){
		  var width = "860px";
		  var height = "660px";
		  var url="postoperative.do?method=query";		 
		  url = url.replace("?","%3f");
		  url = url.replace(/\&/g,"%26");
		  url = url.replace(/\=/g,"%3d");
		  var obj = showModalDialog("dialogWrapper.jsp?url="+url,window,"scroll:no;dialogWidth:" + width + ";status:no;dialogHeight:" + height);
		  if (obj != undefined&&obj != null&&obj != "") {
				var tmp=obj.split("|");			
				$("#spf_id").val(tmp[0]);
				$("#pinyin").val(tmp[1]);
				$("#patient_name").val(tmp[2]);
		}
}



 

子页面:

function okRadio() {
		var vv = $(":radio:checked").val();
		//alert(vv);
		if (vv == undefined) {
			alert("请选择");
		} else {
			vv = $.trim(vv);
			parent.window.returnValue = vv;
			window.close();
		}
	}


 

例子二:

父页面:

function queryList() {
	var _rb_id=$("#_rb_id").val();
	var obj = showModalDialog(
			"outSide.do?method=queryList&rb_id="+_rb_id,
			"",
			"dialogWidth:400px;dialogHeight:560px;toolbar:no;menubar:no;scrollbars:no;resizable:no;location:no;status:no;");
	if (obj != null) {		
		$("#rb_id").val($.trim(obj.id));
		$("#group_id").val($.trim(obj.groupId));
		$("#taskNum").val($.trim(obj.taskNum));
		$("#toCountry").val($.trim(obj.toCountry));
		$("#leaveDate").val($.trim(obj.leaveDate));
		$("#entryDate").val($.trim(obj.entryDate));
		$("#persons").val($.trim(obj.persons));		
	}
}


 

 

子页面:

function save() {
		if(id==""){
			alert("请选择");
			return;
		}
		var id_value = document.getElementById(id).value;
		var array=id_value.split("|");

		var obj=new Object();		
		obj.id=array[0];
		obj.groupId=array[1];
		obj.taskNum=array[2];
		obj.toCountry=array[3];
		obj.toCountryIds=array[4];
		obj.leaveDate=array[5];
		obj.entryDate=array[6];
		obj.persons=array[7];
		obj.personIds=array[8];
		obj.inMoney=array[9];
			
		parent.window.returnValue = obj;
		window.close();
	}



 

 

 

你可能感兴趣的:(function,object,null,url,query,scroll)