ExtJs中Ajax.request异步处理后,跳转至其他页面的超链接 :
1.进入JSP页面:
Ext.Ajax.request({
method:'POST',
url:'paAction.do?actionType=piliang_caigou',
success: function(response){
var json=Ext.decode(response.responseText);
if(json.success){
Ext.Msg.alert('提示','採購單號:'+json.msg+',保存成功!',function(){
win_supp.hide();
var url="";
//var value=encodeURIComponent(json.msg);
var value=json.msg;
if(pa_type=='6'){
url="getMJOAction.do?typeid=3&method=getmjodetail&id="+value;
}else if(pa_type=='7'){
url="getPo_modAction.do?method=getcustdetail&id="+value;
}else{
url="getPurchaseOrderAction.do?method=getcustdetail&id="+value;
}
window.location.href(url);
});
}else{
Ext.Msg.alert('提示',json.msg);
}
},
failure:function(response){
Ext.Msg.alert('提示','生成採購單失敗!');
},
params:{
json1:str,
json2:str2,
supp_id:supp_id
}
});
2.打开一個在Ext.onReady(function(){ })立即执行函数,外面的窗口函数(调用此js文件不会自动加载的窗口函数)---通过超链接调用;
{
header:'採購狀態',
dataIndex:'is_wanjie_cg',
menuDisabled:true,
width:100,
renderer:function(value, cellmeta, record, rowIndex, columnIndex, store){
var pa_no= record.get('pa_no');
return "<a href=# οnclick=' var value=" + '"' + pa_no + '"' + "; new trigger(value)'> "+value+" </a> ";
}
}
3.打开其他js页面的內容---通过超链接调用;
{
header:'申購單',
dataIndex:'pa_no',
menuDisabled:true,
width:150,
renderer:function(value, cellmeta, record, rowIndex, columnIndex, store){
//var pa_no=encodeURIComponent(Ext.encode(value));
var pa_no=value
return "<a href='pa.jsp?pa_no="+pa_no+"' >"+value+"</a>";
}
}
ExtJs中Ajax.request异步处理后,跳转至其他页面的超链接
最新推荐文章于 2023-09-18 13:32:56 发布