1
1
< div class ="container ">
2
2
< div class ="col-xs-8 col-md-offset-2 ">
3
3
4
- < input [ngModel] ="activePage " (ngModelChange) ="activePage = toInt($event) "/>
5
- < input [ngModel] ="rowsOnPage " (ngModelChange) ="rowsOnPage = toInt($event) "/>
4
+ < div class ="page-header ">
5
+ < h1 >
6
+ < span > Angular2 DataTable component</ span > < br />
7
+ < small > by mariuszfoltak</ small >
8
+ </ h1 >
9
+ </ div >
6
10
7
- < table class ="table table-striped " [mfTable] ="data " #mf ="mfTable ">
8
- < thead >
9
- < tr >
10
- < th style ="width: 20% "> < mfDefaultSorter by ="name "> Name</ mfDefaultSorter > </ th >
11
- < th style ="width: 50% "> < mfDefaultSorter by ="email "> Email</ mfDefaultSorter > </ th >
12
- < th style ="width: 10% "> < mfDefaultSorter by ="age "> Age</ mfDefaultSorter > </ th >
13
- < th style ="width: 20% "> < mfDefaultSorter by ="city "> City</ mfDefaultSorter > </ th >
14
- </ tr >
15
- </ thead >
16
- < tbody >
17
- < tr *ngFor ="#item of mf.data ">
18
- < td > {{item.name}}</ td >
19
- < td > {{item.email}}</ td >
20
- < td class ="text-right "> {{item.age}}</ td >
21
- < td > {{item.city}}</ td >
22
- </ tr >
23
- </ tbody >
24
- < tfoot >
11
+ < h2 > Simple data table</ h2 >
12
+
13
+ < div class ="panel panel-default ">
14
+ < div class ="panel-heading "> User information</ div >
15
+
16
+ < table class ="table table-striped " [mfData] ="data " #mf ="mfDataTable ">
17
+ < thead >
18
+ < tr >
19
+ < th style ="width: 20% ">
20
+ < mfDefaultSorter by ="name "> Name</ mfDefaultSorter >
21
+ </ th >
22
+ < th style ="width: 50% ">
23
+ < mfDefaultSorter by ="email "> Email</ mfDefaultSorter >
24
+ </ th >
25
+ < th style ="width: 10% ">
26
+ < mfDefaultSorter by ="age "> Age</ mfDefaultSorter >
27
+ </ th >
28
+ < th style ="width: 20% ">
29
+ < mfDefaultSorter by ="city "> City</ mfDefaultSorter >
30
+ </ th >
31
+ </ tr >
32
+ </ thead >
33
+ < tbody >
34
+ < tr *ngFor ="#item of mf.data ">
35
+ < td > {{item.name}}</ td >
36
+ < td > {{item.email}}</ td >
37
+ < td class ="text-right "> {{item.age}}</ td >
38
+ < td > {{item.city | uppercase}}</ td >
39
+ </ tr >
40
+ </ tbody >
41
+ < tfoot >
25
42
< tr >
26
43
< td colspan ="4 ">
27
- < mfDefaultPaginator [rowsOnPageSet] ="[1,2,3,5,8,13,21,34] " [(rowsOnPage)] ="rowsOnPage "
28
- [(activePage)] ="activePage " #mbp > </ mfDefaultPaginator >
44
+ < mfBootstrapPaginator [rowsOnPageSet] ="[5,10,25] " [rowsOnPage] ="5 "> </ mfBootstrapPaginator >
29
45
</ td >
30
46
</ tr >
31
- </ tfoot >
32
- </ table >
33
- < mfDefaultPaginator [rowsOnPageSet] ="[1,2,3,5,8,13,21,34] " [mfTable] ="mf "> </ mfDefaultPaginator >
34
-
35
- </ div >
36
- < div class ="col-xs-6 col-md-offset-3 ">
37
-
38
- < table class ="table table-striped " [mfTable] ="data " #mf2 ="mfTable ">
39
- < thead >
40
- < tr >
41
- < th > < mfSort by ="name "> Name</ mfSort > </ th >
42
- < th > < a (click) ="mf2.sort('score') "> Score</ a > </ th >
43
- < th > Abec</ th >
44
- </ tr >
45
- </ thead >
46
- < tbody >
47
- < tr *ngFor ="#item of mf2.data ">
48
- < td > {{item.name}}</ td >
49
- < td > {{item.score}}</ td >
50
- < td > {{item.abec}}</ td >
51
- </ tr >
52
- </ tbody >
53
- </ table >
54
-
47
+ </ tfoot >
48
+ </ table >
49
+ </ div >
55
50
</ div >
56
51
</ div >
0 commit comments