Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (42 sloc) 1023 Bytes
<title>PURE Unobtrusive Rendering Engine</title>
<script src="../libs/jquery.js"></script>
<script src="../libs/pure.js"></script>
<!-- HTML template -->
var data = {
{name:'dog', legs:4},
{name:'cat', legs:4},
{name:'bird', legs:2},
{name:'mouse', legs:4}
//declaration of the actions PURE has to do
var directive = {
//sort function like the ususal Array.sort
sort:function(a, b){
return > ? 1 : -1;
//if the returned value is false, the rendering will be skipped for this entry
return a.context.legs === a.item.legs;
// note the use of render instead of autoRender, and the 2nd argument
$('ul').render(data, directive);
Jump to Line
Something went wrong with that request. Please try again.