SearchPanes "Clear All" button to also clear search box?

SearchPanes "Clear All" button to also clear search box?

Nick HopeNick Hope Posts: 30Questions: 10Answers: 0

Is there a way to make the SearchPanes "Clear All" button also clear the regular search filter box?

A test case would be my page at https://fplform.com/fpl-predicted-points

I assume I would have to get the "Clear All" button to run a function, which would run something like this:

$('#players').DataTable().searchPanes.clearSelections();
table.search('').draw();

Answers

  • colincolin Posts: 14,204Questions: 1Answers: 2,408

    You can do something like this here, it's enabling the clear when a search is also present. It doesn't need additional code for the clearing of the panes, as that'll happen automatically.

    Colin

  • Nick HopeNick Hope Posts: 30Questions: 10Answers: 0

    Thank you Colin. That works perfectly :)

Sign In or Register to comment.