Skip to content

Demo: Items Filtering

raid-ox edited this page Sep 13, 2010 · 3 revisions

Demos > Items Filtering

Type e.g. isa in the textfield

First Last

Source

<div>
	<input id="input-filter" type="value" />
</div>
<div id="persons">
	<div class="item"><span class="first">First</span> <span class="last">Last</span></div>
</div>
$('#persons')
	.items([
		{first:'Isaac', last:'Newton'},
		{first:'Johannes', last:'Keppler'},
		{first:'Alessandro', last:'Volta'},
		{first:'Blaise', last:'Pascal'},
		{first:'Niels', last:'Bohr'},
		{first:'Albert', last:'Einstein'},
		{first:'Stephen', last:'Hawking'}
	])
	.chain();
			
$('#input-filter').keyup(function(){
	$('#persons').items('filter', $(this).val());
})

Clone this wiki locally