Skip to content

Commit 5da6511

Browse files
author
skozlov
committed
UI Router - added another state
1 parent 419d955 commit 5da6511

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

demo/bootstrap/js/routerServerPaginationApp.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
templateUrl: 'views/router-server-pagination.html',
2323
controller: MyAppController
2424
})
25+
.state('anotherView', {
26+
url: '/anotherView',
27+
templateUrl: 'views/anotherView.html',
28+
controller: MyAppController
29+
})
2530
}
2631

2732
function MyAppController($scope, myAppFactory, $state) {
@@ -34,7 +39,14 @@
3439
direction: 'asc'
3540
}
3641
};
42+
$scope.UI = {};
3743
$scope.gridActions = {};
44+
$scope.goToAnotherState = function() {
45+
$state.go('anotherView');
46+
};
47+
$scope.back = function() {
48+
$state.go('orders');
49+
};
3850
myAppFactory.getStatuses().then(function (resp) {
3951
$scope.UI.statusOptions = resp.data;
4052
})

demo/bootstrap/ui-router.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@
3636
</ul>
3737
</div>
3838
</nav>
39-
<div ui-view></div>
39+
<div class="container">
40+
<div class="margin-bottom-basic">
41+
<h3>Angular Data Grid - UI Router Server Pagination.</h3>
42+
<a href="https://github.com/angular-ui/ui-router">UI Router</a> plus all features for server pagination.<br/>
43+
<a href="https://github.com/angular-ui/ui-router">UI Router</a> can be used in both modes (hash and html5).
44+
<a href="https://github.com/angular-data-grid/angular-data-grid.github.io" target="_blank">Project GitHub</a>
45+
</div>
46+
<hr>
47+
<div ui-view></div>
48+
</div>
4049
</body>
4150

4251
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script><!-- load jquery -->
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h3>Another View</h3>
2+
<div class="form-group">
3+
<button class="btn btn-primary" ng-click="back()">Back</button>
4+
</div>

demo/bootstrap/views/router-server-pagination.html

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
<div class="container">
2-
<div class="margin-bottom-basic">
3-
<h3>Angular Data Grid - UI Router Server Pagination.</h3>
4-
UI Router plus all features for server pagination<br/>
5-
Features enabled: sorting, filtering (using both in-grid and external controls), pagination and items-per-page functionality.
6-
Angular UI Datepicker used for date controls, although you can use any other framework, plugin or styling.
7-
<a href="https://github.com/angular-data-grid/angular-data-grid.github.io" target="_blank">Project GitHub</a>
2+
<div class="form-group">
3+
<button class="btn btn-primary" ng-click="goToAnotherState()">Go to another state</button>
84
</div>
9-
<hr>
105
<div class="row">
116
<div>
127
<div class="col-md-4">
@@ -117,8 +112,8 @@ <h3>Angular Data Grid - UI Router Server Pagination.</h3>
117112
<table class="table table-bordered">
118113
<thead>
119114
<tr>
120-
<th width="30%" sortable="orderNo" class="sortable">Order #</th>
121-
<th width="30%" sortable="datePlaced" class="sortable">Date Placed</th>
115+
<th width="30%" sortable="orderNo" class="sortable">Order # </th>
116+
<th width="30%" sortable="datePlaced" class="sortable">Date Placed </th>
122117
<th class="st-sort-disable th-dropdown">
123118
<select class="form-control width-15"
124119
filter-by="status"
@@ -131,7 +126,7 @@ <h3>Angular Data Grid - UI Router Server Pagination.</h3>
131126
</option>
132127
</select>
133128
</th>
134-
<th sortable="total" class="sortable">Total</th>
129+
<th sortable="total" class="sortable">Total </th>
135130
</tr>
136131
</thead>
137132
<tbody>

0 commit comments

Comments
 (0)