zoukankan      html  css  js  c++  java
  • mvc4 Jquery 页面打印

    <script src="~/Scripts/js/dist/jquery.jqprint-0.3.js"></script>

    <script type="text/javascript">
        $(function () {
            
            function LoadPrintData()
            {
                $("#dttoexcel").show();
                $("#dttoexcel").jqprint();
                return false;
            }

            //页面打印功能
            $("#printBtn").click(function () {
                var Processid = $("#Process_PTR").children('option:selected').val();
                processName = $("#Process_PTR").children('option:selected').text();
                var begintime = $("#beginDate").val();
                var lasttime = $("#lastDate").val();
                $.ajax({
                    type: "POST",
                    url: '../Assay_BillMain/LoadAssayInfo',
                    async: true,
                    dataType: "text",
                    error: function (request) {
                        alert("请先查出数据");
                    },
                    beforeSend: function () {
                        $("#dttoexcel").hide();
                        $("#exportBtn").attr({ "disabled": "disabled" });
                        $("#printBtn").attr({ "disabled": "disabled" });
                    },
                    success: function (data) {
                        $("#dttoexcel").show();
                        $("#dttoexcel").html(data);
                        LoadPrintData(data);
                        $("#dttoexcel").hide();
                        $("#exportBtn").removeAttr("disabled");//将按钮可用
                        $("#printBtn").removeAttr("disabled");//将按钮可用
                    }
                });
                //防止Ajax页面提交后被刷新
                return false;
            });
        });

    </script>

    <button id="printBtn" role="button" class="btn btn-info btn-small">
          <i class="icon-print icon-white"></i> 打印
    </button>

  • 相关阅读:
    c# DataTable获取某个列的集合
    DataTable中的select()用法(转)
    java中,数组toString()方法,数组常用操作
    C# 如何重写ToString函数及重写的意义,自定义类重写ToString()方法
    重写List 的ToString方法 -------C#
    设置响应报文头 image/jpeg
    response 设置响应头的常用几种方法
    [C#]Http请求报头设置
    HttpContext.Current.Session.Abandon() 大坑 要注意
    for循环拼接字符串去掉最后的逗号
  • 原文地址:https://www.cnblogs.com/Resources-blogs/p/6600978.html
Copyright © 2011-2022 走看看