How can I search in two tables so that for 1st table I want datatables default search functionality

How can I search in two tables so that for 1st table I want datatables default search functionality

karanlkaranl Posts: 6Questions: 3Answers: 0

How can I search in two tables so that for 1st table I want datatables default search functionality and for second I want my custom search?
In my project when I implemented custom search,even when I enter some text in 1st table's search field it was searching in second table.I think this is because of '.dataTables_filter input' class which is same for both search fields of both tables.
Thank you.

This question has an accepted answers - jump to answer

Answers

  • karanlkaranl Posts: 6Questions: 3Answers: 0

    '''$('.dataTables_filter input')
    .off()
    .on('keyup', function() {
    filterByDetailsSearch(this.value);
    }); '''

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    I also answered your question in this thread.

    You can use a selector like this for a specific table: $('#myTable_filter input').

    Kevin

This discussion has been closed.