Download the PHP package deviscoding/searchable without Composer
On this page you can find all versions of the php package deviscoding/searchable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download deviscoding/searchable
More information about deviscoding/searchable
Files in deviscoding/searchable
Download deviscoding/searchable
More information about deviscoding/searchable
Files in deviscoding/searchable
Vendor deviscoding
Package searchable
Short Description Vanilla JS classes for managing search fields, as well as searching DOM elements and JSON sources.
License MIT
Homepage https://www.github.com/jonesiscoding/searchable
Package searchable
Short Description Vanilla JS classes for managing search fields, as well as searching DOM elements and JSON sources.
License MIT
Homepage https://www.github.com/jonesiscoding/searchable
Please rate this library. Is it a good library?
Informations about the package searchable
searchable
Vanilla JS classes for search field callbacks, searching dom elements, and ajax queries.
SearchInput Usage
Normally, this class is used with either DomSearch
or AjaxSearch
, however it may also be used independently using the syntax given below:
let el = document.getElementById('<id of search input>');
let searchCallback = function(query) { console.log('you searched for' + query); };
let clearCallback = function() { console.log('you cleared your search.'; };
let _ = new SearchInput(el, { search: searchCallback, clear: clearCallback });
DomSearch Usage
Given this HTML:
<input type="search" id="searchWithMe">
<table id="content">
<tbody>
<tr><td>things</td></tr>
<tr><td>things and stuff</td></tr>
<tr><td>stuff</td></tr>
</tbody>
</table>
This Javascript would use the class to filter rows based on the entry into the #searchWithMe
input:
let si = document.getElementById('searchWithMe');
let fn = function(isFound) { this.toggleAttribute('hidden', !isFound); }
let _ = new DomSearch(si, { target: '#content tr', result: fn });
AjaxSearch Usage
The code below is an example of how the AjaxSearch
class could be used:
let si = document.getElementById('searchWithMe');
let fnResults = function(data) { <your code to do something with the result data> };
let fnReset = function() { <your code to reset the dom to the pre-search state> };
let _ = new AjaxSearch(si, { results: fnResults, reset: fnReset });
All versions of searchable with dependencies
PHP Build Version
Package Version
No informations.
The package deviscoding/searchable contains the following files
Loading the files please wait ....