9852a640e83b47a5b91e4d4e7761f18b5e35bbbc
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / cat / vandelay / record-items.component.ts
1 import {Component, Input, ViewChild} from '@angular/core';
2 import {Pager} from '@eg/share/util/pager';                                    
3 import {IdlObject} from '@eg/core/idl.service';
4 import {NetService} from '@eg/core/net.service';
5 import {PcrudService} from '@eg/core/pcrud.service';
6 import {AuthService} from '@eg/core/auth.service';
7 import {GridComponent} from '@eg/share/grid/grid.component';
8 import {GridDataSource} from '@eg/share/grid/grid';
9 import {VandelayService} from './vandelay.service';
10
11 @Component({
12   selector: 'eg-queued-record-items',
13   templateUrl: 'record-items.component.html'
14 })
15 export class RecordItemsComponent {
16
17     @Input() recordId: number;
18
19     gridSource: GridDataSource;
20     @ViewChild('itemsGrid') itemsGrid: GridComponent;
21
22     constructor(
23         private net: NetService,
24         private auth: AuthService,
25         private pcrud: PcrudService,
26         private vandelay: VandelayService) {
27
28         this.gridSource = new GridDataSource();
29
30         // queue API does not support sorting
31         this.gridSource.getRows = (pager: Pager) => {
32             return this.pcrud.search('vii', 
33                 {record: this.recordId}, {order_by: {vii: ['id']}});
34         };
35     }
36 }
37