mini.open参数传递

1、A页面

mini.open({
            title: '选择合同明细',
            showMaxButton: true,
            width: 900,
            height: 600,
            url: 'B.html',
            onload: function () {
                var iframe = this.getIFrameEl();
                iframe.contentWindow.SetData(data);
            },
            ondestroy: function (result) {
            	var iframe = this.getIFrameEl();
            	var datas = iframe.contentWindow.GetData();
            	if (typeof(datas) == 'undefined' || !datas || datas.length == 0 ) {
    				return;
    			}
            	//A页面数据处理
            }
	});		 

 

2、B页面

            var querydata ;
	    function SetData(data) {debugger
	    	if(data){
	    		querydata = data;
			 loadInfo();//加载B页面数据
	    	}
        }



           var selectMaterials;
	    
	    function onOk(){
	    	var grid = mini.get('datagrid');
	    	var rows = grid.getSelecteds();
			if(rows.length == 0) {
				mini.alert("请选择一条记录");
				return false;
			}
			selectMaterials = rows;
			onCancel();
	    }
	   
	    
	    function GetData() {
	    	if(selectMaterials.length > 0){
	    		return selectMaterials;
	    	}
        }

 3、后台接收参数:

String contractid = req.getParameter("contractid");
String materialids = req.getParameter("materialids");

 

posted @ 2018-08-23 10:20  筱小Q  阅读(4264)  评论(0编辑  收藏  举报