Click here to Skip to main content
16,022,060 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Thanks a lot Srikant for creating the column filter popup for the datatable but I want these columns filter to be updated dynamically based on the other column filter selections. Can you please help me in this

What I have tried:

I have tried to create the following but it did not help

JQUERY
function updateColumnSearch(column, newTemplate) {
    var searchTerms = [];
    newTemplate.find('input[type="checkbox"]:checked').each(function () {
        searchTerms.push($.fn.dataTable.util.escapeRegex($(this).val()));
    });

    var searchTerm = searchTerms.length > 0 ? '^(' + searchTerms.join('|') + ')$' : '';
    column.search(searchTerm, true, false).draw();
}
Posted
Updated 10-Aug-24 4:35am
v2

1 solution

I have no idea who Shrikant is. If you have a question about the contents of an article, please add it to the forum at the end of the article. If this is meant to be the follow up to a question, you should reply on that question.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900