|
3 | 3 | <head lang="en"> |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <title>Angular Data Grid</title> |
6 | | - <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.0.0/angular-material.min.css"> |
| 6 | + <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
| 7 | + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"> |
| 8 | + <link rel="stylesheet" href="https://cdn.gitcdn.xyz/cdn/angular/bower-material/v1.0.1-master-a687bfc/angular-material.css"> |
7 | 9 | <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> |
8 | 10 | <link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.indigo-blue.min.css"> |
9 | 11 | <link rel="stylesheet" href="material/css/angular-data-grid.material.css"> |
10 | 12 | </head> |
11 | 13 | <body ng-app="myApp" ng-controller="myAppController" ng-cloak> |
12 | 14 | <div layout="column" layout-fill> |
13 | | - <md-toolbar> |
14 | | - <div class="md-toolbar-tools max-width"> |
| 15 | + <md-toolbar layout="row" layout-align="center"> |
| 16 | + <div class="md-toolbar-tools" flex-lg="60" flex-md="80" flex-sm="100"> |
15 | 17 | <span>Angular Data Grid — Material Design</span> |
16 | 18 | <span flex></span> |
17 | | - <md-menu> |
| 19 | + <md-menu md-position-mode="target-right target"> |
18 | 20 | <md-button ng-click="$mdOpenMenu($event)"> |
| 21 | + <span layout="row" layout-align="center center"> |
19 | 22 | Change theme |
| 23 | + <i class="material-icons">arrow_drop_down</i> |
| 24 | + </span> |
20 | 25 | </md-button> |
21 | 26 | <md-menu-content> |
22 | 27 | <md-menu-item> |
|
29 | 34 | </md-menu> |
30 | 35 | </div> |
31 | 36 | </md-toolbar> |
32 | | - <md-content class="layout-padding"> |
33 | | - <div class="max-width"> |
34 | | - <div layout-gt-sm="row" class="layout-gt-sm-row"> |
35 | | - <div class="flex-gt-sm"> |
36 | | - <md-input-container class="md-block flex-gt-sm" flex-gt-sm=""> |
37 | | - <label for="order">Search By Order #</label> |
| 37 | + <md-content layout-padding layout="row" layout-align="center"> |
| 38 | + <div flex-lg="60" flex-md="80" flex-xs="100"> |
| 39 | + <div> |
| 40 | + <h3 class="layout-padding">Angular Data Grid sample using out-of-box Angular Material styling</h3> |
| 41 | + <p class="layout-padding">Features enabled: sorting, filtering (using both in-grid and external controls), pagination and item-per-page functionality. Angular Material Datepickers used for date controls, although you can use any other framework / plugins.<a href="https://github.com/angular-data-grid/angular-data-grid.github.io" target="_blank">Project GitHub</a></p> |
| 42 | + </div> |
| 43 | + <hr class="layout-margin"> |
| 44 | + <div layout-gt-sm="row" layout-sm="column" layout-align="center" class="layout-padding"> |
| 45 | + <div class="controls" flex-gt-sm="33" flex-sm="100" layout="row" layout-align="center start"> |
| 46 | + <md-input-container class="md-block flex-gt-xs flex-xs"> |
| 47 | + <label for="order" class="md-no-float">Search By Order #</label> |
38 | 48 | <input ng-model="code" |
39 | 49 | class="md-input" |
40 | 50 | ng-change="gridActions.filter()" |
|
44 | 54 | aria-invalid="false"> |
45 | 55 | </md-input-container> |
46 | 56 | </div> |
47 | | - <div class="flex-gt-sm" style="padding: 18px 0;"> |
| 57 | + <div class="controls" flex-gt-sm="33" flex-sm="100" layout="column" layout-align="start stretch"> |
| 58 | + <label class="md-datepicker-label">From</label> |
48 | 59 | <md-datepicker ng-model="dateFrom" |
| 60 | + flex="100" |
49 | 61 | md-placeholder="MM/DD/YYYY" |
50 | 62 | is-open="dateFromOpened" |
51 | 63 | ng-click="dateFromOpened = true" |
52 | 64 | filter-by="placed" |
53 | 65 | filter-type="dateFrom" |
54 | 66 | ng-change="gridActions.filter()"></md-datepicker> |
55 | 67 | </div> |
56 | | - <div class="flex-gt-sm" style="padding: 18px 0;"> |
| 68 | + <div class="controls" flex-gt-sm="33" flex-sm="100" layout="column" layout-align="start stretch"> |
| 69 | + <label class="md-datepicker-label">To</label> |
57 | 70 | <md-datepicker ng-model="dateTo" |
| 71 | + flex="100" |
58 | 72 | md-placeholder="MM/DD/YYYY" |
59 | 73 | is-open="dateToOpened" |
60 | 74 | ng-click="dateToOpened = true" |
|
63 | 77 | ng-change="gridActions.filter()"></md-datepicker> |
64 | 78 | </div> |
65 | 79 | </div> |
| 80 | + <hr class="layout-margin"> |
66 | 81 | <div grid-data id='test' grid-options="gridOptions" grid-actions="gridActions"> |
67 | | - <div class="controls-wrap clearfix"> |
68 | | - <strong class="items">Found: {{filtered.length}} items</strong> |
| 82 | + <div layout-gt-xs="row" layout-xs="column" layout-align="center" class="layout-padding"> |
| 83 | + <div flex-gt-xs="25" flex-xs="100" layout="row" layout-align="start center"> |
| 84 | + <strong>Found: {{filtered.length}} items</strong> |
| 85 | + </div> |
| 86 | + <div flex-gt-xs="75" flex-xs="100"> |
| 87 | + <div layout="row" layout-align="end center"> |
| 88 | + <grid-pagination max-size="5" |
| 89 | + boundary-links="true" |
| 90 | + class="pagination-sm" |
| 91 | + ng-if="paginationOptions.totalItems > paginationOptions.itemsPerPage" |
| 92 | + total-items="paginationOptions.totalItems" |
| 93 | + ng-model="paginationOptions.currentPage" |
| 94 | + ng-change="reloadGrid()" |
| 95 | + items-per-page="paginationOptions.itemsPerPage"></grid-pagination> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | + </div> |
| 99 | + <div class="layout-padding"> |
| 100 | + <table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp"> |
| 101 | + <thead> |
| 102 | + <tr> |
| 103 | + <th sortable="code" class="sortable mdl-data-table__cell--non-numeric" > |
| 104 | + Order # |
| 105 | + </th> |
| 106 | + <th class="st-sort-disable th-dropdown"> |
| 107 | + <md-select filter-by="statusDisplay" |
| 108 | + filter-type="select" |
| 109 | + ng-model="status" |
| 110 | + placeholder="Status" |
| 111 | + ng-change="filter()"> |
| 112 | + <md-option value="">All Statuses</md-option> |
| 113 | + <md-option ng-repeat="option in statusOptions track by option.value" |
| 114 | + value="{{option.value}}"> |
| 115 | + {{option.text}} |
| 116 | + </md-option> |
| 117 | + </md-select> |
| 118 | + </th> |
| 119 | + <th sortable="placed" class="sortable"> |
| 120 | + Date Placed |
| 121 | + </th> |
| 122 | + <th sortable='total.value' class="sortable"> |
| 123 | + Total |
| 124 | + </th> |
| 125 | + </tr> |
| 126 | + </thead> |
| 127 | + <tbody> |
| 128 | + <tr grid-item> |
| 129 | + <td class="mdl-data-table__cell--non-numeric"> |
| 130 | + <span ng-bind="item.code"></span> |
| 131 | + </td> |
| 132 | + <td ng-bind="item.statusDisplay"></td> |
| 133 | + <td ng-bind="item.placed | date:'MM/dd/yyyy'"></td> |
| 134 | + <td ng-bind="item.total.formattedValue"></td> |
| 135 | + </tr> |
| 136 | + </tbody> |
| 137 | + </table> |
| 138 | + </div> |
| 139 | + <div layout="row" layout-align="end center" class="layout-padding"> |
69 | 140 | <grid-pagination max-size="5" |
70 | 141 | boundary-links="true" |
71 | 142 | class="pagination-sm" |
72 | 143 | ng-if="paginationOptions.totalItems > paginationOptions.itemsPerPage" |
73 | 144 | total-items="paginationOptions.totalItems" |
74 | 145 | ng-model="paginationOptions.currentPage" |
75 | 146 | ng-change="reloadGrid()" |
| 147 | + previous-text="‹" next-text="›" first-text="«" last-text="»" |
76 | 148 | items-per-page="paginationOptions.itemsPerPage"></grid-pagination> |
77 | 149 | </div> |
78 | | - <table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp"> |
79 | | - <thead> |
80 | | - <tr> |
81 | | - <th sortable="code" class="sortable"> |
82 | | - Order # |
83 | | - </th> |
84 | | - <th class="st-sort-disable th-dropdown"> |
85 | | - <md-select filter-by="statusDisplay" |
86 | | - filter-type="select" |
87 | | - ng-model="status" |
88 | | - placeholder="Status" |
89 | | - ng-change="filter()"> |
90 | | - <md-option value="">All Statuses</md-option> |
91 | | - <md-option ng-repeat="option in statusOptions track by option.value" |
92 | | - value="{{option.value}}"> |
93 | | - {{option.text}} |
94 | | - </md-option> |
95 | | - </md-select> |
96 | | - </th> |
97 | | - <th sortable="placed" class="sortable"> |
98 | | - Date Placed |
99 | | - </th> |
100 | | - <th sortable='total.value' class="sortable"> |
101 | | - Total |
102 | | - </th> |
103 | | - </tr> |
104 | | - </thead> |
105 | | - <tbody> |
106 | | - <tr grid-item> |
107 | | - <td> |
108 | | - <span ng-bind="item.code"></span> |
109 | | - </td> |
110 | | - <td ng-bind="item.statusDisplay" class="mdl-data-table__cell--non-numeric"></td> |
111 | | - <td ng-bind="item.placed | date:'MM/dd/yyyy'"></td> |
112 | | - <td ng-bind="item.total.formattedValue"></td> |
113 | | - </tr> |
114 | | - </tbody> |
115 | | - </table> |
116 | | - <div class="controls-wrap"> |
117 | | - <grid-pagination max-size="5" |
118 | | - boundary-links="true" |
119 | | - class="pagination-sm" |
120 | | - ng-if="paginationOptions.totalItems > paginationOptions.itemsPerPage" |
121 | | - total-items="paginationOptions.totalItems" |
122 | | - ng-model="paginationOptions.currentPage" |
123 | | - ng-change="reloadGrid()" |
124 | | - previous-text="‹" next-text="›" first-text="«" last-text="»" |
125 | | - items-per-page="paginationOptions.itemsPerPage"></grid-pagination> |
126 | | - </div> |
127 | | - <div class="controls-wrap"> |
| 150 | + <div layout="row" layout-align="end center" class="layout-padding"> |
128 | 151 | <div grid-item-per-page="10, 25, 50, 75"></div> |
129 | 152 | </div> |
130 | 153 | </div> |
| 154 | + <hr class="layout-margin"> |
131 | 155 | </div> |
132 | 156 | </md-content> |
133 | 157 | </div> |
|
0 commit comments