Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/archakov06/jquery-easysearch
jQuery plugin for filtering elements
https://github.com/archakov06/jquery-easysearch
Last synced: about 4 hours ago
JSON representation
jQuery plugin for filtering elements
- Host: GitHub
- URL: https://github.com/archakov06/jquery-easysearch
- Owner: Archakov06
- License: other
- Created: 2016-04-10T21:18:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-21T10:18:42.000Z (about 8 years ago)
- Last Synced: 2024-11-08T13:16:31.505Z (12 days ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 10
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jQuery-easySearch
A jQuery plug-in for filtering elements with user input.
![Example work](http://archakov.im/uploads/search-in-list_480db9c7.gif)
## Usage
#### Example #1: UL
```js
$('input').jSearch({
selector : 'ul',
child : 'li div.header',
minValLength: 0,
Found : function(elem){
$(elem).parent().parent().show();
},
NotFound : function(elem){
$(elem).parent().parent().hide();
},
After : function(t){
if (!t.val().length) $('ul li').show();
}
});
```#### Example #2: Table
```js
$('input').jSearch({
selector : 'table',
child : 'tr > td',
minValLength: 0,
Before: function(){
$('table tr').data('find','');
},
Found : function(elem){
$(elem).parent().data('find','true');
$(elem).parent().show();
},
NotFound : function(elem){
if (!$(elem).parent().data('find'))
$(elem).parent().hide();
},
After : function(t){
if (!t.val().length) $('table tr').show();
}
});
```## Options
* **selector**
The selector that will occur search for child elements
* **child**
The child element that will be searched
* **minValLength**
The minimum number of characters to search
* **onFound**
The function is called if there is a match
* **onNotFound**
The function is called if there is no match
* **onBefore**
Function to call before trigger is called
* **onAfter**
Function to call after trigger is called
## Contacts
* **E-Mail**
* **Website**
## License
Now licensed under the MIT License: