ExtJs调用Ajax后,超链接跳转至其他页面

//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=#  onclick=' 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>";

        }

    }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值