To follow through this tutorial, you will first need to have the quicksearch plugin, which can be found here.
At work, we recently had a client that wanted to search through a table. This plugin worked great for that. Well, then he decided it would be great to have a little button next to the text field that allows the user to clear the search, and have the table return to its default state. Well, that meant diving into the code. So... here's how to do it...
When you open the file, you will find several functions that do different things. You will also see near the bottom, a list of options. We will need to first add some options for the reset button. Here is what I used:
reset: false, //Is reset enabled? (true/false)
resetId: 'resetQS', //ID for reset button.
resetClass: null, //Class for reset button.
resetLabel: 'Reset', //Text inside reset button.
You can see the comments for what each of these do. Now, let's put those to work!
We first will make the function that actually inputs the button. Place this anywhere with the other functions (I put it in front of the init() function.