Skip to content

Commit 29b4874

Browse files
author
Andrew Perlitch
committed
updated demo
1 parent 75ba168 commit 29b4874

File tree

4 files changed

+51
-14
lines changed

4 files changed

+51
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
angular-mesa
22
====================
33

4-
A table component built in angular. Handles large datasets by virtualizing rows.
4+
A table component built in angular. Handles large datasets by virtualizing rows. [Live demo](http://andyperlitch.github.io/angular-mesa/)
55

66
Feature List
77
------------

app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<li><a href="#">kitchen sink</a></li>
4545
<li><a href="#/max-height">max height</a></li>
4646
<li><a href="#/expandable">expandable rows</a></li>
47+
<li><a href="http://andyperlitch.github.io/angular-mesa/">github</a></li>
4748
</ul>
4849
</div><!-- /.navbar-collapse -->
4950
</div><!-- /.container-fluid -->

app/scripts/controllers/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ angular.module('apMesa.ghPage')
102102
loading: true,
103103
loadingPromise: dataDfd.promise
104104
};
105+
$scope.my_table_options_paginate = angular.extend({}, $scope.my_table_options, {
106+
pagingStrategy: 'PAGINATE',
107+
rowsPerPage: 8
108+
});
105109

106110
// kick off interval that updates the dataset
107111
setInterval(function() {

app/views/main.html

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ <h5>Features</h5>
1616
<li>stacked ordering</li>
1717
<li>localStorage/custom state persistance</li>
1818
<li>rows are virtualized (can handle a lot of rows)</li>
19+
<li>pagination</li>
1920
</ul>
2021
</div>
2122
</div>
@@ -29,17 +30,48 @@ <h5>Kitchen Sink Example:</h5>
2930
<br>
3031
<br>
3132

33+
<div ng-init="pagingScheme = 'scroll'">
34+
<div class="btn-group" role="group">
35+
<button
36+
ng-disabled="pagingScheme == 'scroll'"
37+
ng-click="pagingScheme = 'scroll'"
38+
type="button"
39+
class="btn btn-primary"
40+
>scroll</button>
41+
<button
42+
ng-disabled="pagingScheme == 'paginate'"
43+
ng-click="pagingScheme = 'paginate'"
44+
type="button"
45+
class="btn btn-primary"
46+
>paginate</button>
47+
</div>
48+
<div ng-if="pagingScheme == 'scroll'">
49+
<ap-mesa
50+
columns="my_table_columns"
51+
rows="my_table_data"
52+
selected="my_selected_rows"
53+
class="col-sm-9"
54+
options="my_table_options"
55+
table-class="table">
56+
</ap-mesa>
57+
<div class="col-sm-3">
58+
<h4>Selected rows: </h4>
59+
<pre>{{my_selected_rows | json}}</pre>
60+
</div>
61+
</div>
3262

33-
Selected rows:
34-
35-
<ap-mesa
36-
columns="my_table_columns"
37-
rows="my_table_data"
38-
selected="my_selected_rows"
39-
class="col-sm-9"
40-
options="my_table_options"
41-
table-class="table">
42-
</ap-mesa>
43-
44-
45-
<pre class="col-sm-3">{{my_selected_rows | json}}</pre>
63+
<div ng-if="pagingScheme == 'paginate'">
64+
<ap-mesa
65+
columns="my_table_columns"
66+
rows="my_table_data"
67+
selected="my_selected_rows"
68+
class="col-sm-9"
69+
options="my_table_options_paginate"
70+
table-class="table">
71+
</ap-mesa>
72+
<div class="col-sm-3">
73+
<h4>Selected rows: </h4>
74+
<pre>{{my_selected_rows | json}}</pre>
75+
</div>
76+
</div>
77+
</div>

0 commit comments

Comments
 (0)