import {Component, Input, Output, OnInit, AfterViewInit, EventEmitter,
OnDestroy, HostListener, ViewEncapsulation} from '@angular/core';
-import {Subscription} from 'rxjs/Subscription';
+import {Subscription} from 'rxjs';
import {IdlService} from '@eg/core/idl.service';
import {OrgService} from '@eg/core/org.service';
import {ServerStoreService} from '@eg/core/server-store.service';
// The value is prefixed with 'eg.grid.'
@Input() persistKey: string;
+ @Input() disableSelect: boolean;
+
// Prevent selection of multiple rows
@Input() disableMultiSelect: boolean;
// Allow the caller to jump directly to a specific page of
// grid data.
@Input() pageOffset: number;
+ // Pass in a default page size. May be overridden by settings.
+ @Input() pageSize: number;
+
+ // If true and an idlClass is specificed, the grid assumes
+ // datatype=link fields that link to classes which define a selector
+ // are fleshed with the linked object. And, instead of displaying
+ // the raw field value, displays the selector value from the linked
+ // object. The caller is responsible for fleshing the appropriate
+ // fields in the GridDataSource getRows handler.
+ //
+ // This only applies to auto-generated columns.
+ //
+ // For example, idlClass="aou" and field="ou_type", the display
+ // value will be ou_type().name() since "name" is the selector
+ // field on the "aout" class.
+ @Input() showLinkSelectors: boolean;
+
+ @Input() disablePaging: boolean;
context: GridContext;
this.context.isSortable = this.sortable === true;
this.context.isMultiSortable = this.multiSortable === true;
this.context.useLocalSort = this.useLocalSort === true;
+ this.context.disableSelect = this.disableSelect === true;
+ this.context.showLinkSelectors = this.showLinkSelectors === true;
this.context.disableMultiSelect = this.disableMultiSelect === true;
this.context.rowFlairIsEnabled = this.rowFlairIsEnabled === true;
this.context.rowFlairCallback = this.rowFlairCallback;
+ this.context.disablePaging = this.disablePaging === true;
if (this.showFields) {
this.context.defaultVisibleFields = this.showFields.split(',');
}
this.context.pager.offset = this.pageOffset;
}
+ if (this.pageSize) {
+ this.context.pager.limit = this.pageSize;
+ }
+
// TS doesn't seem to like: let foo = bar || () => '';
this.context.rowClassCallback =
this.rowClassCallback || function () { return ''; };