background-color: rgb(248, 248, 248);
}
- .eg-grid-scroll {overflow-y:scroll; height: 600px}
-
.eg-grid-row {
width: 100%;
display: flex;
padding-right: 1px;
}
+ /* hack to make the header columns line up with the content columns
+ when the scroll bar is visible along the right side of the content
+ columns. TODO: if this varies enough by browser, we'll need to
+ calculate the width instead. */
+ .eg-grid-scroll > .eg-grid-header-row,
+ .eg-grid-scroll > .eg-grid-conf-row {
+ padding-right: 15px;
+ }
+ .eg-grid-scroll > .eg-grid-content-body {
+ overflow-y:scroll;
+ height: 600px; /* TODO: configurable */
+ }
+
</style>
-<div class="eg-grid" ng-class="{'eg-grid-as-conf' : showGridConf}">
+<div class="eg-grid"
+ ng-class="{'eg-grid-as-conf' : showGridConf,'eg-grid-scroll' : isScroll}">
<!-- import embedded eg-grid-field defs via no-op transclude -->
<div ng-transclude></div>
<!-- ============== -->
<!-- grid data rows -->
- <div class="eg-grid-row"
- ng-repeat="item in list.items"
- ng-class="{'eg-grid-row-selected' : itemIsSelected(item)}">
- <div class="eg-grid-cell eg-grid-cell-1"
- ng-click="handleRowClick($event, item)">
- {{$index + 1 + list.pageOffset}}
- </div>
- <div class="eg-grid-cell eg-grid-cell-1">
- <!-- ng-click=handleRowClick here has unintended
- consequences and is unnecessary, avoid it -->
- <input type='checkbox'
- ng-model="list.selected[list.indexValue(item)]"/>
- </div>
- <div class="eg-grid-cell"
- ng-click="handleRowClick($event, item)"
- ng-repeat="column in list.allColumns"
- style="flex:{{column.flex}}"
- ng-show="list.displayColumns[column.name]">
- {{list.fieldValue(item, column.name) | egGridvalueFilter:column}}
+ <div class="eg-grid-content-body">
+ <div class="eg-grid-row"
+ ng-repeat="item in list.items"
+ ng-class="{'eg-grid-row-selected' : itemIsSelected(item)}">
+ <div class="eg-grid-cell eg-grid-cell-1"
+ ng-click="handleRowClick($event, item)">
+ {{$index + 1 + list.pageOffset}}
+ </div>
+ <div class="eg-grid-cell eg-grid-cell-1">
+ <!-- ng-click=handleRowClick here has unintended
+ consequences and is unnecessary, avoid it -->
+ <input type='checkbox'
+ ng-model="list.selected[list.indexValue(item)]"/>
+ </div>
+ <div class="eg-grid-cell"
+ ng-click="handleRowClick($event, item)"
+ ng-repeat="column in list.allColumns"
+ style="flex:{{column.flex}}"
+ ng-show="list.displayColumns[column.name]">
+ {{list.fieldValue(item, column.name) | egGridvalueFilter:column}}
+ </div>
</div>
</div>
</div>
require : '^egGrid',
restrict : 'AE',
transclude : true,
- scope : {name : '@', path : '@', label : '@', flex : '@'},
+ scope : {
+ name : '@', // required; unique name
+ path : '@', // optional; flesh path
+ label : '@', // optional; display label
+ flex : '@', // optoinal; default flex width
+ },
template : '<div></div>', // NOOP template
link : function(scope, element, attrs, egGridCtrl) {
egGridCtrl.addColumn(scope);