Fast Data Live Seach Filter Plugin With jQuery Nozzle - Download Fast Data Live Seach And Filter Plugin With jQuery - Nozzle

Download Fast Data Live Seach And Filter Plugin With jQuery – Nozzle

Posted on

This time I will share jQuery Plugin and tutorial about Fast Data Live Seach And Filter Plugin With jQuery – Nozzle, hope it will help you in programming stack.

Fast Data Live Seach Filter Plugin With jQuery Nozzle - Download Fast Data Live Seach And Filter Plugin With jQuery - Nozzle
File Size: 26.2 KB
Views Total: 921
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Nozzle is a lightweight and easy-to-use jQuery plugin that creates multiple filter controls to filter your large data sets on client side.

Basic usage:

1. To use this plugin, you have to download and load the Nozzle plugin after jQuer library as follow:

1 <script src="//code.jquery.com/jquery-3.1.0.slim.min.js"></script>
2 <script src="dist/jquery.nozzle.min.js"></script>

2. Let’s say you have an array of data objects as shown below:

01 var samples = [
02     {
03       title: "Item 1",
04       desc: "This is description for Item #"
05     },
06     {
07       title: "Item 2",
08       desc: "Description for Item #"
09     },
10     {
11       title: "Item 2a",
12       desc: "This is Item #"
13     },
14     {
15       title: "Item 3",
16       desc: "This is description for Item #"
17     }
18     ...
19   ];

3. Create filter controls:

1 <input class="form-control" name="title_filter" value="">
2 <input class="form-control" name="desc_filter" value="">
3 <select class="form-control" name="title_select_filter">
4   <option value="">Any</option>
5   <option value="Item 1">Item 1</option>
6   <option value="Item 2">Item 2</option>
7   <option value="Item 2a">Item 2a</option>
8 </select>

4. The JavaScript to active the plugin.

01 var $titleInput = $('input[name=title_filter]');
02 var $descInput = $('input[name=desc_filter]');
03 var $titleSelect = $('select[name=title_select_filter]');
04  
05 $.nozzle.liveFilter({
06   data: sample,
07   filters: [
08     {
09       attribute: 'title',
10       value: $titleInput
11     },{
12       attribute: 'desc',                      
13       value: $descInput
14     },{
15       attribute: 'title',
16       value: $titleSelect,
17       match: 'exact'
18     }
19 ]
20 });

5. All default options and callbacks.

1 $.nozzle.liveFilter({
2   data: null,
3   deferRender: true,
4   deferRenderDelay: 300,
5   filters: [],
6   filterCallback: null,
7   render: false,
8   renderCallback: null
9 });

Change log:

2016-08-20

  • Ability to save filter in location hash

2016-08-12

  • New two-way data binding function

This awesome jQuery plugin is developed by marcinjackowiak. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net