我想显示和隐藏表列搜索字段



我有数据表和每列的搜索字段。现在,我通过mobilejquery应用显示和隐藏列。它工作得很好,但问题是当我取消选中一列时,该列是隐藏的,但该列的搜索文件不是隐藏的enter code here$('#myTable thead tr'(.clone(true(.appendTo('#myTable thead'(;

$('#myTable thead tr:eq(1) th').each( function (i) {
let title = $(this).text();
$(this).html( '<input type="text" style="max-width: 70px;" placeholder="Search" />' );
$( 'input', this ).on( 'keyup change', function () {
if (window.table.column(i).search() !== this.value ) {
window.table
.column(i)
.search( this.value )
.draw();
}
} );
} );

请检查您的表结构,输入字段是附加的,然后尝试重新排序您的表,这将解决您的问题。如果你不明白我说了什么,请上传你的表格截图。没有人能在不看到表结构的情况下解决这个问题。

最新更新