table.columns is not a function in datatable.js

前端 未结 8 1716
鱼传尺愫
鱼传尺愫 2021-02-01 13:12



        
8条回答
  •  耶瑟儿~
    2021-02-01 13:29

    Try something like this

    var table = $('#sample_3').dataTable();
    $('#sample_3 tfoot th').each(function (i) 
    {
    
                var title = $('#sample_3 thead th').eq($(this).index()).text();
                // or just var title = $('#sample_3 thead th').text();
                var serach = '';
                $(this).html('');
                $(serach).appendTo(this).keyup(function(){table.fnFilter($(this).val(),i)})
    });
    

提交回复
热议问题