如何将带有列过滤器的打印按钮与jquriey数据表一起使用? [英] How to use print button with column filter with jquriey datatable ?

查看:176
本文介绍了如何将带有列过滤器的打印按钮与jquriey数据表一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Datatable Controle中使用带有列过滤器的Print,exportToPdf,按钮
来自 DataTables | jQuery的表插件 [ ^ ]

问题是代码可以正常运行,但不显示按钮.

我尝试过的事情:

这是我的代码

Hi I want to use Print ,exportToPdf, button with Column Filter in Datatable Controle
From DataTables | Table plug-in for jQuery[^]

the problem is code run fine but not showing button.

What I have tried:

here is my code

<script>

    $(document).ready(function () {
        // Setup - add a text input to each footer cell
        $(''#<%= GridView1.ClientID %> thead tr'').clone(true).appendTo(''#<%= GridView1.ClientID %> thead'');

        $(''#<%= GridView1.ClientID %> thead tr:eq(1) th'').each(function (i) {
            var title = $(this).text();
            $(this).html(''<input type="text" placeholder="Search '' + title + ''" />'');

            $(''input'', this).on(''keyup change'', function () {
                if (table.column(i).search() !== this.value) {
                    table
                    .column(i)
                    .search(this.value)
                    .draw();
                }

            });


        });

        var table = $(''#<%= GridView1.ClientID %>'').DataTable({
            orderCellsTop: true,
            fixedHeader: true,
 dom: ''Bfrtip'',
                buttons: [
            ''print'',
            ''excelHtml5'',
            ''csvHtml5'',
            ''pdfHtml5''

        ]



        });
    });				   
</script>

推荐答案

(document).ready(function(){ //设置-向每个页脚单元格添加文本输入
(document).ready(function () { // Setup - add a text input to each footer cell


(``#<%= GridView1.ClientID%> thead tr'').clone(true).appendTo( ``#<%= GridView1.ClientID%> thead'');
(''#<%= GridView1.ClientID %> thead tr'').clone(true).appendTo(''#<%= GridView1.ClientID %> thead'');


(``#<%= GridView1.ClientID%> thead tr:eq(1) th'').each(function(i){ var title =
(''#<%= GridView1.ClientID %> thead tr:eq(1) th'').each(function (i) { var title =


这篇关于如何将带有列过滤器的打印按钮与jquriey数据表一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆