通过form 表单和隐藏域传值 <script> var fjmc=window.parent.document.all.fjmctext.value; document.getElementByIdx_x_x_x("aaa").value = fjmc;
myForm.action="collectionSendToExcel.action"; myForm.submit(); </scritp> <form action="#" id="myFormToExcel" name="myFormToExcel">
<input type="hidden" name="fjmc" id="aaa" /> <input type="text" name="action" /> <input type="submit" value="提交'> </form>
通过Ajax传递:
function commit(){ var myMask = new Ext.LoadMask(Ext.getBody(), {msg: '正在提交数据,请稍后...'}); myMask.show(); Ext.Ajax.request({ form: 'myForm', method: 'post', success: function(response, option){ myMask.hide(); var results = Ext.util.JSON.decode(response.responseText); var msgs = '【承兑保证操作成功!】' switch(results.type){ case '1': msgs = '【保证人账号不能为空,操作失败】'; break; case '2': msgs = '【访问数据库发生异常,操作失败】'; break; } Ext.Msg.show({ title:'信息提示', modal:false, msg: msgs, buttons: Ext.Msg.OK, fn:function(btn,text){ if(btn == 'ok'){ if(results.success){ comBack(g('SBillType').value);//返回列表 } } }, animEl: 'elId', icon: Ext.MessageBox.INFO }); }, failure: function(response,option){ myMask.hide(); Ext.MessageBox.alert("信息提示","【提交数据超时,请稍候再试...】"); } });
} 还有就通过jquery 的ajax var fjmc=window.parent.document.all.fjmctext.value; Ext.Ajax.request({ url : 'messageReport.action?' + param , method : 'post' , success : function(response){ var result = Ext.util.JSON.decode(response.responseText); if(result.flag == 'success'){ Ext.Msg.alert('系统提示',result.msg,function(){ Ext.getCmp('requisitionGridId').getStore().reload(); }); }else{ Ext.MessageBox.alert('系统提示',result.msg,function(){ Ext.getCmp('requisitionGridId').getStore().reload(); }); } } });
});
-----------------------------------------------------------------------------------------
第四种方式:
<script type="text/javascript"> function collectionSendToExcel(){ var billNo=document . getElementById('billNo').value; var SOrgCode=document.getElementByIdx_x("SOrgCode").value; var account=document . getElementById('account').value; var SCustBankCode=document . getElementById('SCustBankCode').value; var operType=document . getElementById('operType').value; location.href="collectionSendToExcel.action?querybean.billNo=" + billNo+"&customer.SOrgCode"+SOrgCode+"&account.SAccountNo"+account+"&account.SCustBankCode"+SCustBankCode;
} </script>