1+ < 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 >
8+ </ div >
9+ < hr >
10+ < div class ="row ">
11+ < div >
12+ < div class ="col-md-4 ">
13+ < div class ="form-group ">
14+ < label for ="orderIdFilter "> Search by Order #</ label >
15+ < input id ="orderIdFilter " type ="text " class ="form-control order-search-box "
16+ placeholder ="Enter Order # "
17+ ng-change ="gridActions.filter() "
18+ ng-model ="orderNo "
19+ filter-by ="orderNo "
20+ filter-type ="text ">
21+ </ div >
22+ </ div >
23+ < div class ="col-md-4 ">
24+ < div class ="form-group ">
25+ < label for ="dateFromFilter "> Date From</ label >
26+
27+ < div class ="input-group ">
28+ < input type ="text "
29+ id ="dateFromFilter "
30+ class ="form-control "
31+ uib-datepicker-popup ="dd/MM/yyyy "
32+ placeholder ="DD/MM/YYYY "
33+ max-date ="dateTo "
34+ close-text ="Close "
35+ ng-model ="dateFrom "
36+ show-weeks ="true "
37+ is-open ="dateFromOpened "
38+ ng-click ="dateFromOpened = true "
39+ filter-by ="placed "
40+ filter-type ="dateFrom "
41+ ng-blur ="gridActions.filter() "
42+ ng-focus ="gridActions.filter() "
43+ show-weeks ="false "
44+ close-text ="Close "/>
45+ < span class ="input-group-btn ">
46+ < label for ="dateFromFilter " class ="btn btn-default ">
47+ < i class ="fa fa-calendar "> </ i > </ label >
48+ </ span >
49+ </ div >
50+ </ div >
51+ </ div >
52+ < div class ="col-md-4 ">
53+ < div class ="form-group ">
54+ < label for ="dateToInput "> Date To</ label >
55+
56+ < div class ="input-group ">
57+ < input type ="text "
58+ id ="dateToInput "
59+ class ="form-control "
60+ uib-datepicker-popup ="dd/MM/yyyy "
61+ placeholder ="DD/MM/YYYY "
62+ min-date ="dateFrom "
63+ close-text ="Close "
64+ ng-model ="dateTo "
65+ show-weeks ="true "
66+ is-open ="dateToOpened "
67+ ng-click ="dateToOpened = true "
68+ filter-by ="placed "
69+ filter-type ="dateTo "
70+ ng-blur ="gridActions.filter() "
71+ ng-focus ="gridActions.filter() "
72+ show-weeks ="false "
73+ close-text ="Close ">
74+ < span class ="input-group-btn ">
75+ < label for ="dateToInput " class ="btn btn-default ">
76+ < i class ="fa fa-calendar "> </ i > </ label >
77+ </ span >
78+ </ div >
79+ </ div >
80+ < div ng-show ="dateTo || dateFrom " class ="buttons-right ">
81+ < a href ="" ng-click ="dateTo = ''; dateFrom = ''; gridActions.refresh(); "> Clear Dates</ a >
82+ </ div >
83+ </ div >
84+ </ div >
85+ </ div >
86+
87+
88+ < div grid-data grid-options ="gridOptions " grid-actions ="gridActions " server-pagination ="true ">
89+ < div class ="row ">
90+ < div class ="col-md-3 "> < span class ="items "> {{paginationOptions.totalItems}} items total</ span > </ div >
91+ < div class ="col-md-9 text-right ">
92+ < form class ="form-inline margin-bottom-basic ">
93+ < div class ="form-group ">
94+ < div grid-pagination boundary-links ="true "
95+ ng-if ="paginationOptions.totalItems > paginationOptions.itemsPerPage "
96+ total-items ="paginationOptions.totalItems "
97+ ng-model ="paginationOptions.currentPage "
98+ ng-change ="reloadGrid() "
99+ class ="pagination-sm "
100+ items-per-page ="paginationOptions.itemsPerPage ">
101+ </ div >
102+ </ div >
103+ < div class ="form-group items-per-page ">
104+ < label for ="itemsOnPageSelect1 "> Items per page:</ label >
105+ < select id ="itemsOnPageSelect1 " class ="form-control input-sm " ng-init ="paginationOptions.itemsPerPage = '10' " ng-model ="paginationOptions.itemsPerPage "
106+ ng-change ="reloadGrid() ">
107+ < option > 5</ option >
108+ < option > 10</ option >
109+ < option > 50</ option >
110+ < option > 75</ option >
111+ </ select >
112+ </ div >
113+ </ form >
114+ </ div >
115+ </ div >
116+
117+ < table class ="table table-bordered ">
118+ < thead >
119+ < tr >
120+ < th width ="30% " sortable ="orderNo " class ="sortable "> Order #</ th >
121+ < th width ="30% " sortable ="datePlaced " class ="sortable "> Date Placed</ th >
122+ < th class ="st-sort-disable th-dropdown ">
123+ < select class ="form-control width-15 "
124+ filter-by ="status "
125+ filter-type ="select "
126+ ng-model ="status "
127+ ng-change ="filter() ">
128+ < option value =""> All Statuses</ option >
129+ < option ng-repeat ="option in UI.statusOptions track by option.value "
130+ value ="{{option.value}} "> {{option.text}}
131+ </ option >
132+ </ select >
133+ </ th >
134+ < th sortable ="total " class ="sortable "> Total</ th >
135+ </ tr >
136+ </ thead >
137+ < tbody >
138+ < tr grid-item >
139+ < td > {{item.orderNo}}</ td >
140+ < td > {{item.datePlaced | date:'MM/dd/yyyy'}}</ td >
141+ < td > {{item.status}}</ td >
142+ < td > {{item.total}}</ td >
143+ </ tr >
144+ </ tbody >
145+ </ table >
146+ < div class ="row ">
147+ < div class ="col-md-3 "> < span class ="items "> {{paginationOptions.totalItems}} items total</ span > </ div >
148+ < div class ="col-md-9 text-right ">
149+ < form class ="form-inline margin-bottom-basic ">
150+ < div class ="form-group ">
151+ < div grid-pagination boundary-links ="true "
152+ ng-if ="paginationOptions.totalItems > paginationOptions.itemsPerPage "
153+ total-items ="paginationOptions.totalItems "
154+ ng-model ="paginationOptions.currentPage "
155+ ng-change ="reloadGrid() "
156+ class ="pagination-sm "
157+ items-per-page ="paginationOptions.itemsPerPage ">
158+ </ div >
159+ </ div >
160+ < div class ="form-group items-per-page ">
161+ < label for ="itemsOnPageSelect "> Items per page:</ label >
162+ < select id ="itemsOnPageSelect " class ="form-control input-sm " ng-init ="paginationOptions.itemsPerPage = '10' " ng-model ="paginationOptions.itemsPerPage "
163+ ng-change ="reloadGrid() ">
164+ < option > 5</ option >
165+ < option > 10</ option >
166+ < option > 50</ option >
167+ < option > 75</ option >
168+ </ select >
169+ </ div >
170+ </ form >
171+ </ div >
172+ </ div >
173+ </ div >
174+ </ div >
0 commit comments