Save filtering when sorting

Save filtering when sorting

AlexanrdAlexanrd Posts: 2Questions: 1Answers: 0

Hey. Tell me how to save the filter when sorting. Or how to sort in the filtered data https://jsfiddle.net/Ahtetep/10uhwapv/ .

Answers

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946
    edited July 2018

    With the code you have you are removing you custom search plug-in with this if statement:

    if(this.checked){
    

    Updated your example to look like this:

           //if not checked remove filter
           if(!this.checked){
              $.fn.dataTable.ext.search.pop(); 
              table.draw();
           }
    

    https://jsfiddle.net/jL7cfows/7/

    Kevin

  • AlexanrdAlexanrd Posts: 2Questions: 1Answers: 0

    Got it. Thank you

This discussion has been closed.