datatable 表头增加搜索

Posted on 2020-06-15 17:46  凡凡0410  阅读(518)  评论(0编辑  收藏  举报
 1 $('#table thead tr').clone(true).appendTo('#table_box thead');
 2 $('#table thead tr:eq(1) th').each( function (i) {
 3         var title = $(this).text();
 4         var index = $(this).index();
 5         var enVal = columns[index].enVal;
 6         // 列搜索
 7         $(this).html('<input type="text" style="width:100%;" class="column_search_input" data-column="'+ index +'" data-en="'+enVal+'"/>');
 8         $('input', this).on( 'keyup change', function (e) {
 9             代码code
11         })        
13 })

 

Copyright © 2024 凡凡0410
Powered by .NET 9.0 on Kubernetes