码迷,mamicode.com
首页 > Web开发 > 详细

mvc4 Jquery 页面打印

时间:2017-03-22 17:47:56      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:pts   date   disabled   java   var   功能   load   .sh   span   

<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>

mvc4 Jquery 页面打印

标签:pts   date   disabled   java   var   功能   load   .sh   span   

原文地址:http://www.cnblogs.com/Resources-blogs/p/6600978.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!