Auto filter 4 tables using one input field

Auto filter 4 tables using one input field

philip123philip123 Posts: 1Questions: 1Answers: 0

I have 4 tables built using datatables and each one has its own search bar, is it possible to reach the scenario where I only type what I want to search in one search bar and it will pull data from the 4 tables.
if it is possible can someone help in, Thank you in advance

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,342Questions: 26Answers: 4,954
    Answer ✓

    One option to get the data from all the tables based on the search term is to use the search event for the first table. First get the search term using search(). Use rows().data() with the row-selector as a function for all the tables. Check if the search term is contained within the row or certain columns as required.

    Kevin

Sign In or Register to comment.