Wijmo 5 - CollectionView Navigators
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.grapecity.com/wijmo/5.latest/styles/wijmo.min.css">
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.input.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.grid.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/interop/angular/wijmo.angular.min.js"></script>
<!-- mark this as an Angular application and give it a controller -->
<div ng-app="app" ng-controller="appCtrl" class="container">
<h1>CollectionView Navigators</h1>
<p>Choose the page:</p>
<wj-collection-view-pager cv="data">
</wj-collection-view-pager>
<p></p>
<p>Choose the item within the page:</p>
<wj-collection-view-navigator cv="data">
</wj-collection-view-navigator>
<p></p>
<p>Here is the data:</p>
<wj-flex-grid style="max-height:300px" items-source="data">
</wj-flex-grid>
</div>
JavaScript
// define app, include Wijmo 5 directives
var app = angular.module('app', ['wj']);
// controller
app.controller('appCtrl', function ($scope) {
// create lots of items
var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','),
data = [];
for (var i = 0; i < 100000; i++) {
data.push({
id: i,
country: countries[i % countries.length],
downloads: Math.round(Math.random() * 20000),
sales: Math.random() * 10000,
expenses: Math.random() * 5000
});
}
// create CollectionView, set page size to 20
var cv = new wijmo.collections.CollectionView(data);
cv.pageSize = 20;
$scope.data = cv;
});