infopath表单加超链接
2020-05-21 10:41:12
709次阅读
2个回答
infopath表单子表上,通过某一个字段,加超链接,可以跳到另外一张表单上查看此条的原始单据,该怎么设置,有没有相应的示例参考一下
收藏 0

登录 后回答问题。没有帐号? 注册 一个。

    2020-05-21 23:13:59
    最佳答案

    1.写infopath自定义扩展控件的js:

    //自定义infopath链接扩展控件(链接打开页面)参数说明:
    //this:指向一个div的控件容器,扩展的控件,添加到这里面即可
    //dataStoreCtrl:值存储控件
    //extendConfig:表单里配置的扩展配置,字符串
    // 1.(iframe打开)eg:{"btntitle":"查看","formid":"4e7bf8ca37814d3e889e6e6fecf21580","mode":"iframe"}
    // 2.(弹出)eg:{"btntitle":"查看","formid":"4e7bf8ca37814d3e889e6e6fecf21580","mode":"show"}
    function linkbtn(dataStoreCtrl, extendConfig) {
        debugger
        //是否禁用(一般是infopath条件样式或者infopath设定)
        var isDisabled = 'true' == $(this).attr('disabled') || 'disabled' == $(this).attr('disabled');

        // 是否只读
        var isPrint = '1' === $(this).attr('esprint');

        // 当前的值,也就是表单里存储的值
        var curVal = isPrint ? $(this).attr('esdataval') : dataStoreCtrl.val();
        
        var cfg = $.parseJSON(extendConfig);
        
        if (curVal!=''){
            if(cfg.mode=='iframe'){
                var btn = $('<button type="button" class="btn btn-primary" onclick="$(&quot;iframe[esctrl=iframe]&quot;).attr(&apos;src&apos;,&apos;/Platform/UIV2/Form/ShowForm.html?publishId='+cfg.formid+'&eskeyvalue='+curVal+'&esprintview=true&apos;)">'+cfg.btntitle+'</button>');
                this.append(btn);
            }
            else{
                var btn = $('<button type="button" class="btn btn-primary" onclick="esPrintDialog(&apos;'+cfg.formid+'&apos;,&apos;'+curVal+'&apos;)">'+cfg.btntitle+'</button>');
                this.append(btn);
            }
        }
    }

    2.在infopath里设定infopath自定义扩展控件

    2.1(点击弹出):

    2.2(iframe打开):

    3.显示效果

    3.1(弹出):

    3.2(iframe显示):

    2020-05-21 23:02:42
    最佳答案

    参照帮助直接使用infopath扩展控件,自己写js实现即可:

    http://fewebhelp.31yun.cn


共2条 1

aqing

  • 0 回答
  • 0 粉丝
  • 0 关注