-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathpager.component.ts
80 lines (65 loc) · 2.63 KB
/
pager.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { Component, ElementRef, ViewContainerRef, ChangeDetectionStrategy, QueryList, Renderer2, Injector, ValueProvider, ContentChild } from '@angular/core';
import { ComponentBase, IComponentBase, applyMixins, ComponentMixins, PropertyCollectionInfo, setValue } from '@syncfusion/ej2-angular-base';
import { Pager } from '@syncfusion/ej2-grids';
import { Template } from '@syncfusion/ej2-angular-base';
export const inputs: string[] = ['cssClass','currentPage','customText','enableExternalMessage','enablePagerMessage','enablePersistence','enableQueryString','enableRtl','externalMessage','locale','pageCount','pageSize','pageSizes','template','totalRecordsCount'];
export const outputs: string[] = ['click','created','dropDownChanged','currentPageChange','pageSizeChange','pageCountChange','pageSizesChange'];
export const twoWays: string[] = ['currentPage', 'pageSize', 'pageCount', 'pageSizes'];
/**
* `ejs-pager` represents the Angular Pager Component.
* ```html
* <ejs-pager></ejs-pager>
* ```
*/
@Component({
selector: 'ejs-pager',
inputs: inputs,
outputs: outputs,
template: '',
changeDetection: ChangeDetectionStrategy.OnPush,
queries: {
}
})
@ComponentMixins([ComponentBase])
export class PagerComponent extends Pager implements IComponentBase {
public context : any;
public tagObjects: any;
click: any;
created: any;
dropDownChanged: any;
currentPageChange: any;
pageSizeChange: any;
pageCountChange: any;
public pageSizesChange: any;
/**
* Defines the template as string or HTML element ID which renders customized elements in pager instead of default elements.
* @default null
* @asptype string
*/
@ContentChild('template')
@Template()
public template: any;
constructor(private ngEle: ElementRef, private srenderer: Renderer2, private viewContainerRef:ViewContainerRef, private injector: Injector) {
super();
this.element = this.ngEle.nativeElement;
this.injectedModules = this.injectedModules || [];
this.registerEvents(outputs);
this.addTwoWay.call(this, twoWays);
setValue('currentInstance', this, this.viewContainerRef);
this.context = new ComponentBase();
}
public ngOnInit() {
this.context.ngOnInit(this);
}
public ngAfterViewInit(): void {
this.context.ngAfterViewInit(this);
}
public ngOnDestroy(): void {
this.context.ngOnDestroy(this);
}
public ngAfterContentChecked(): void {
this.context.ngAfterContentChecked(this);
}
public registerEvents: (eventList: string[]) => void;
public addTwoWay: (propList: string[]) => void;
}