click button twice button duplicate header table
click button twice button duplicate header table

my "input filter" in header of table, when i click twice in my button, the header of the my table is duplicate
This discussion has been closed.
my "input filter" in header of table, when i click twice in my button, the header of the my table is duplicate
Answers
Without seeing your code its impossible to help debug. Please post a link to your page or a test case replicating the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
function filtbresosPrest() {
/* when click twice, here is duplicate*/
$(this).html('<input type="text" class="form-control form-control-sm" placeholder="Filtar por ' + title + '" style="width:100px" />');
}
this my table
("
")````
$('#tbresumoEmp thead tr').clone(true).appendTo('#tbresumoEmp thead');
$('#tbresumoEmp thead tr:eq(1) th').each(function(i) {
var title = $(this).text();
// console.log($(this).html())
//here
$(this).html('<input type="text" class="form-control form-control-sm" placeholder="Filtar por ' + title + '" style="width:100px" />');
I meant to create a running example that we can look at. Its not easy to look at a bunch of code to understand how it is behaving. Please post a running test case that shows the issue.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin