Fork me on GitHub

jQuery jPList plugin is deprecated. Please check pure JavaScript (ES6) jPList Library alternative instead.

Checkbox Text Filter Control Usage

Checkbox Text Filter Control

Add jPList scripts to the HEAD:

    
<!-- jPList Core -->		
<link href="jplist.core.min.css" rel="stylesheet" type="text/css" />
<script src="jplist.core.min.js"></script>	
<!-- Toogle Filters Bundle -->			
<link href="jplist.filter-toggle-bundle.min.css" rel="stylesheet" type="text/css" />
<script src="jplist.filter-toggle-bundle.min.js"></script>
<script>
$('document').ready(function(){
	$('#demo').jplist({				
		itemsBox: '.list' 
		,itemPath: '.list-item' 
		,panelPath: '.jplist-panel'	
	});
	
});
</script>
			
	

Add basic HTML structure to the BODY:

    
<!-- demo -->
<div id="demo">
	
	<!-- panel -->
	<div class="jplist-panel">						
		<!-- checkbox text filter -->
		<div
		   class="jplist-group"
		   data-control-type="checkbox-text-filter"
		   data-control-action="filter"
		   data-control-name="keywords"
		   data-path=".keywords"
		   data-logic="or">
		   <input
			  value="architecture"
			  id="architecture"
			  type="checkbox"
		   />
		   <label for="architecture">Architecture</label>
		   <input
			  value="christmas"
			  id="christmas"
			  type="checkbox"
		   />
		   <label for="christmas">Christmas</label>
		   <input
			  value="nature"
			  id="nature"
			  type="checkbox"
		   />
		   <label for="nature">Nature</label>
		   <input
			  value="lifestyle"
			  id="lifestyle"
			  type="checkbox"
		   />
		   <label for="lifestyle">Lifestyle</label>
		</div>
		
	</div>				 
	
	<!-- HTML data -->   
	<div class="list">
		
		<!-- item 1 -->
		<div class="list-item">	
			...
		</div>
		
		<!-- item 2 -->
		<div class="list-item">	
			...
		</div>
		
		...
		
	</div>
	
	<!-- no results found -->
	<div class="jplist-no-results">
		<p>No results found</p>
	</div>
					
</div>