.eg-grid-action-row {
border: none;
justify-content:flex-end; /* i.e. float right */
+
+ /* margin should not have to be this large; something's up */
+ margin-bottom: 15px;
}
.eg-grid-header-row {
</div>
</div>
+<!--
+<br/>
+-->
+
<div ng-show="list.items.length == 0"
class="alert alert-info">[% l('No Items To Display') %]</div>
style="flex:{{column.flex}}"
ng-show="list.displayColumns[column.name]">
<a href="javascript:;" ng-click="sortOn(column.name)">{{column.label}}</a>
+ <div style="height:100%;color:black">
+ foo
+
+ </div>
</div>
</div>
<eg-grid-field path="name" flex="5"></eg-grid-field>
<eg-grid-field path="id"></eg-grid-field>
<eg-grid-field path="ou_type.depth"></eg-grid-field>
- <eg-grid-field path="billing_address.street1" flex="3"></eg-grid-field>
+ <eg-grid-field path="billing_address.street1" flex="3" label="[% l('Address') %]"></eg-grid-field>
<eg-grid-field path="opac_visible"></eg-grid-field>
<eg-grid-field path="phone"></eg-grid-field>
<eg-grid-field path="email"></eg-grid-field>
--- /dev/null
+
+<eg-grid
+ persist-key="eg.staff.test.grid.auto-fields"
+ idl-class="rmsr"
+ is-scroll="true"
+ sort="testGridSort"
+ query="testGridQuery"
+ auto-fields="true"/>
function($scope, $timeout, $modal, egIDL, egAuth, egNet, egList) {
var self = this;
- // TODO: dynamic
- this.limit = 20;
- this.ofset = 0;
+ // setup function, called at the end of the controller
+ this.init = function() {
+ self.limit = 25;
+ self.ofset = 0;
- $scope.list = $scope.egList || egList.create();
+ if (!$scope.query) {
+ console.error("egGrid requires a query");
+ return;
+ }
+
+ if (!$scope.idlClass) {
+ console.error("egGrid requires an idlClass");
+ return;
+ }
+
+ $scope.list = $scope.egList || egList.create();
+
+ if ($scope.autoFields)
+ self.compileAutoFields();
+
+ $scope.list.indexField = $scope.idField;
+ }
// column-header click quick sort
$scope.sortOn = function(col_name) {
$scope.list.resetPageData();
- if (!$scope.query) {
- console.error("egGrid requires a query");
- return;
- }
-
- if (!$scope.idlClass) {
- console.error("egGrid requires an idlClass");
- return;
- }
-
- if ($scope.autoFields)
- self.compileAutoFields();
-
- $scope.list.indexField = $scope.idField;
var queryFields = {}
angular.forEach($scope.list.allColumns, function(field) {
// update to new last-selected
self.lastSelectedRowIndex = index;
+ // select each row between the last selected and
+ // currently selected items
while (true) {
startPos += ascending ? 1 : -1;
var curItem = $scope.list.items[startPos];
$scope.list.indexValue(item)
];
}
+
+ this.init();
}
};
})
this.selected = {};
this.indexValue = function(item) {
- if (!item) return null;
- // assumes non-object's are bare indexes
- if (typeof item != 'object') return item;
- if (this.indexFieldAsFunction) {
- return item[this.indexField]();
- } else {
- return item[this.indexField];
+ if (angular.isObject(item)) {
+ if (item !== null) {
+ if (this.indexFieldAsFunction)
+ return item[this.indexField]();
+ return item[this.indexField];
+ }
}
+ // passed a non-object; assume it's an index
+ return item;
}
// returns true if item1 appears in the list before item2;
resolve : resolver
});
+ $routeProvider.when('/test/autogrid2', {
+ templateUrl: './test/t_autogrid2',
+ controller: 'TestGridCtrl2',
+ resolve : resolver
+ });
+
+
//$routeProvider.otherwise({redirectTo : '/circ/patron/search'});
})
})
});
+})
+
+.controller('TestGridCtrl2', function($scope, $timeout, egList) {
+ var self = this;
+ console.log('TestGridCtrl2');
+ $scope.testGridQuery = {id : {'<>' : null}};
+ $scope.testGridSort = []
});
+