Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
192 lines (139 sloc) 4.49 KB
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Backbone.js pagination</title>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
</head>
<body>
<div class="container">
<p>&nbsp;</p>
<div class="page-header">
<h1>Backbone.js Paginator 0.12 <small>a paginator component for Backbone</small></h1>
</div>
<h3>Client-data pagination</h3>
<ul id="content">
</ul>
<ul id="pagination">
</ul>
<h3>Server-data pagination</h3>
<ul id="content2">
</ul>
<div id="pagination2">
</div>
<div class="alert-message block-message warning">
<p>Note: The Netflix OData feed may not return the last page depending the query used and approximation of total results returned. For customization, 'last' functioning is entirely dependant on how your backend returns results.</p>
</div>
<h3>Credits</h3>
<p>
<ul>
<li>Server-data version and client-data refactor: @addyosmani</li>
<li>Initial work on client-side version: @bmsterling</li>
</ul>
</p>
</div>
<!-- client pagination -->
<script type="text/html" id="tmpClientPagination">
<div class="breadcrumb">
<span class="cell last pages">
<% if (page != 1) { %>
<a href="#" class="first">First</a>
<a href="#" class="prev">Previous</a>
<% } %>
<% _.each (pageSet, function (p) { %>
<% if (page == p) { %>
<span class="page selected"><%= p %></span>
<% } else { %>
<a href="#" class="page"><%= p %></a>
<% } %>
<% }); %>
<% if (lastPage != page) { %>
<a href="#" class="next">Next</a>
<a href="#" class="last">Last</a>
<% } %>
</span>
<span class="cell howmany">
Show
<a href="#" class="selected">20</a>
|
<a href="#" class="">50</a>
|
<a href="#" class="">100</a>
</span>
<span class="cell first records">
<span class="current"><%= startRecord %></span>
-
<span class="perpage"><%= endRecord %></span>
of
<span class="total"><%= totalRecords %></span>
shown
</span>
<span class="cell sort">
<a href="#" class="sortAsc btn small">Sort (Asc)</a>
<a href="#" class="sortDsc btn small">Sort (Desc)</a>
</span>
<select id="sortByOption">
<option value="cid">cid</option>
<option value="name">name</option>
</select>
</div>
</script>
<!-- server pagination -->
<script type="text/html" id="tmpServerPagination">
<div class="breadcrumb">
<span class="cell ">
<% if (page > 1) { %>
<a href="#" class="serverprevious">Previous</a>
<% }else{ %>
<span>Previous</span>
<% }%>
<% if (page < totalPages) { %>
<a href="#" class="servernext">Next</a>
<% } %>
<% if (lastPage != page) { %>
<a href="#" class="serverlast">Last</a>
<% } %>
<span class="cell serverhowmany">
Show
<a href="#" class="selected">20</a>
|
<a href="#" class="">50</a>
|
<a href="#" class="">100</a>
</span>
<span class="cell first records">
<span class="current"><%= page %></span>
of
<span class="total"><%= totalPages %></span>
shown
</span>
<span class="cell sort">
<a href="#" class="orderUpdate btn small">Sort by:</a>
</span>
<select id="sortByField">
<option value="ReleaseYear">Release year</option>
<option value="month(Instant/AvailableFrom)">Release month</option>
</select>
</span>
</div>
</script>
<!-- scripts-->
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="libs/underscore.js"></script>
<script src="libs/json2.js"></script>
<script src="libs/backbone.js"></script>
<script src="app.js"></script>
<!--Pagination-->
<script src="utils/backbone.paginator.client.js"></script>
<script src="utils/backbone.paginator.server.js"></script>
<!--Models/Collections-->
<script src="models/Tag.js"></script>
<script src="collections/TagsClient.js"></script>
<script src="collections/TagsServer.js"></script>
<!--Views-->
<script src="views/TagsClient.js"></script>
<script src="views/TagsServer.js"></script>
<script src="views/clientPagination.js"></script>
<script src="views/serverPagination.js"></script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.