This time I will share jQuery Plugin and tutorial about Live Searching & Filtering For Large Data Sets With jQuery Quick Search Plugin, hope it will help you in programming stack.
Quick Search is an useful and high-performance jQuery plugin for live searching/filtering large data sets from data tables, lists, JSON data, etc.
Features:
- Search tables on rows or <th> elements only.
- Search html lists with javascript.
- Search data from a external file (such as JSON data) with ajax.
- Lots of options to customize.
- Callback events supported.
Basic Usage:
1. Load the jQuery javascript library and jQuery Quick Search plugin in your document.
2 |
< script src = "src/jquery.quicksearch.js" ></ script > |
2. Create an input filed that accepts the search keywords or filter characters.
1 |
< input type = "text" name = "search" value = "" id = "demo" placeholder = "Search" autofocus /> |
3. Create a data table or html lists you want to search/filter.
01 |
< table id = "table_example" > |
05 |
< th width = "30%" >Email</ th > |
06 |
< th width = "10%" >Id</ th > |
07 |
< th width = "10%" >Phone</ th > |
08 |
< th width = "10%" >Total</ th > |
09 |
< th width = "10%" >Ip</ th > |
10 |
< th width = "10%" >Url</ th > |
11 |
< th width = "10%" >Time</ th > |
12 |
< th width = "10%" >ISO Date</ th > |
13 |
< th width = "10%" >UK Date</ th > |
20 |
< th >devo@flexomat.com</ th > |
24 |
< td >172.78.200.124</ td > |
4. Call the plugin and you’re done.
3 |
$( 'input#demo' ).quicksearch( 'table tbody tr' ); |
5. All the default options.
01 |
$( 'input#demo' ).quicksearch( 'table tbody tr' , { |
21 |
// The amounts of matched results |
22 |
matchedResultsCount: 0, |
24 |
// Event that the trigger is tied to. |
27 |
// Event that the reset event is tied to |
30 |
// Search on specific keycode |
33 |
// Remove diacritics from the search input. |
34 |
removeDiacritics: false, |
36 |
// Establish a minimum length that the search value must have in order to perform the search. |
39 |
// Function to call before trigger is called |
42 |
// Function to call after trigger is called |
45 |
// Function to call when the value does not exceeds the minValLength option. |
46 |
onValTooSmall: $.noop, |
48 |
// Function to call when no results are found. |
49 |
onNoResultFound: null, |
51 |
// Function that will add styles to matched elements |
56 |
// Function that will add styles to unmatched elements |
61 |
// Function that transforms text from input_selector into query used by ' testQuery ' function |
62 |
source : jqueryscript.net