Fork me on GitHub

Remove an Item Using API

<script>
$('document').ready(function(){
	var $demo = $('#demo')
		,html
		,$el;
		
	//item html
	html = '<div class="list-item box">\
		<div class="img left">\
			<img title="" alt="" src="../assets/img/thumbs/arch-1.jpg">\
		</div>\
		<div class="block right">\
			<p class="date">03/15/2012</p>\
			<p class="title">Arch 1</p>\
			<p class="desc">Test description</p>\
			<p class="like">6 Likes</p>\
			<p class="theme">\
				<span class="architecture">Architecture</span>\
			</p>\
		</div>\
	</div>';
	
	$el = $(html);
	
	//init jplist first time
	$demo.jplist({				
		itemsBox: '.list' 
		,itemPath: '.list-item' 
		,panelPath: '.jplist-panel'	
	});
		
	//delete item from jplist collection
	$demo.jplist({
		command: 'del'
		,commandData: {
			$item: $el
		}
	});
	
});
</script>