ExtJS弹窗刷新父页面

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u011287511/article/details/65446718

页面如下:


点击弹窗里的“激活”后应更新父页面记录的状态

代码:

<%@ page contentType="text/html; charset=utf-8"%>
<%
	String panelid = request.getParameter("panelid");
	String data[] = request.getParameterValues("ids");
	String gridId = request.getParameter("gridId");
%>
<script type="text/javascript">
Ext.onReady(function(){
	var id = '<%=panelid%>';
	var panel = Ext.getCmp(id);
	var win = panel.findParentByType('window');
	var buttons = [{
		text : '激活',
		iconCls : 'icon-sys-confirm',
		handler : function(){
			panel.submit(panel);
			win.close();
		}
	},{
		text : '取消',
		iconCls : 'icon-sys-cancel',
		handler : function(){
			win.close();
		}
	}];
	var formpanel = new Ext.form.FormPanel({
		autoScroll : true,
		border : false,
		buttons : buttons,
		bodyStyle : "padding:10px;padding-right:20px",
		defaults : {
			labelWidth : 15,
		    labelAlign : "left",
			border : false,
			layout : 'form'
		},
		items : [{ // 行1
	        layout : "column", // 从左往右的布局
	        fieldLabel:'会员状态',
	        items : [{
	     			xtype:'combo',
	    			anchor:'100%',
	    			id:'f_state',
	    			name:'f_state',
	    			editable:false,
	    			allowBlank:false,
	    			triggerAction:'all',
	    			mode:'local',
	    			valueField:'value',
	    			displayField:'display',
	    			store:Mixky.app.Dictionarys['mem_state'],
	    			queryMode: 'local'
	       			}]
	        }]
	});

	panel.submit = function(panel){
		var mainPanel = panel;
		if (Ext.getCmp('f_state').getValue() == '') {
			Ext.Msg.alert('错误', '请选择激活后的会员状态');
			return;
		}else{
			var ids = new Array();
			<%
			for(int i=0;i<data.length;i++){
			%>
				ids.push('<%=data[i] %>');
			<%	
			}
			%>
			var state=Ext.getCmp('f_state').getValue();
			MemberDirect.activateMember(ids,state,function(result,e){
				if(result && result.success){
					MixkyApp.showInfoMessage('激活成功','提示信息');
					Ext.getCmp('<%=gridId%>').getStore().reload();
				}else{
					MixkyApp.showErrorMessage('激活出现错误!', '错误提示');
				}
			});
		}
	};
	panel.add(formpanel);	
});
</script>



展开阅读全文

window.showModalDialog 刷新页面问题?

07-05

先上代码:rn GridView1_RowDataBound 里的rn[code=C#]rnHyperLink link = (HyperLink)e.Row.FindControl("HyperLink1");rn string url = "javascript:varwin=window.showModalDialog('I_nei_add.aspx?id=" + id + "&number=" + this.lab_dhNo.Text.Trim() + "&rand=" + new Random().Next(100000, 999999).ToString() + "',null,'dialogWidth=650px,dialogHeight=400px,window.location.href = window.location.href);');if(win==1) window.location.reload();";rn link.NavigateUrl = string.Format(url,id);rn[/code]rn点击GridView行修改 按钮 弹出窗口 rn修改信息,修改完后,关闭窗口,刷新父页面数据。rn修改页面的btn_edit事件rn[code=C#]rn...model.bz = this.txt_bz.Text;rnISQL.Inei_update(model);rnHttpContext.Current.Response.Write(" ");rn[/code]rn[color=#FF0000]最终实际效果他并没有刷新父页面!怎么回事?[/color]rnrn但是同样的如果是添加信息的话,父页面就刷新了,代码是一样的,rnrn添加按钮 弹出窗口事件rn[code=C#]rn string aurl = "javascript:var win=window.showModalDialog('I_nei_add.aspx?number=0&rand=" + new Random().Next(100000, 999999).ToString() + "',null,'dialogWidth=650px,dialogHeight=400px,window.location.href = window.location.href);');if(win==1) window.location.reload();";rnHyperLink1.NavigateUrl = string.Format(aurl, this.lab_dhNo.Text.Trim());rn[/code]rn(修改,添加是同一个页面)btn_add事件rn[code=C#]rnISQL.I_pm_add(inermodel);rnHttpContext.Current.Response.Write(" ");rn[/code]rnrn这个添加好后 关闭页面,就刷新父页面了!rnrn谁能帮我解决,是怎么回事呢? 论坛

没有更多推荐了,返回首页