This is a migrated thread and some comments may be shown as answers.

Exposing some more types for importing

2 Answers 160 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mojtaba
Top achievements
Rank 1
Mojtaba asked on 11 Feb 2019, 12:09 PM

Hello,

I would like to import PagerTemplateDirectivePDFServiceSuspendService, and ExcelService types which are not exposed in '@progress/kendo-angular-grid' directly. At the moment I'm doing this by importing from '@progress/kendo-angular-grid/dist/es/......' which is not recommended.

I'll try explaining why I need these types in the following lines briefly.

 

1. PagerTemplateDirective:

I want to change the pager template of my grid dynamically in code under certain circumstances. So, I need to have an instance of PagerTemplateDirective in my code to assign to 'this.grid.pagerTemplate'.

 

2. PDFService and SuspendService:

I want to extend PDFComponent class and use this extended (customised) component for PDF export in my grids. However, the constructor requires PDFService and SuspendService; see the following code:

export class KendoGridTypicalPdfComponent extends PDFComponent implements OnInit {
 
  @ViewChild(PDFMarginComponent)
  public marginComponent: PDFMarginComponent;
 
  @ViewChild(PDFTemplateDirective)
  public pageTemplateDirective: PDFTemplateDirective;
  constructor(protected pdfService: PDFService,
    protected suspendService: SuspendService,
    protected ngZone: NgZone,
    element: ElementRef) {
 
    super(pdfService, suspendService, ngZone, element);
  }
 
  ngOnInit(): void {
    this.scale = 0.6;
    this.paperSize = 'A4';
    this.landscape = true;
  }
}

 

3. ExcelService:

The same story for Excel export as PDF export.

export class KendoGridTypicalExcelComponent extends ExcelComponent implements OnInit {
 
  constructor(protected excelService: ExcelService,
    protected localizationService: LocalizationService) {
 
    super(excelService, localizationService);
  }
}

 

Thanks,

Mojtaba

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 13 Feb 2019, 12:04 PM
Hello Mojtaba,

Thank you for explaining the need for exporting the described types that are typically for internal use, from the Grid package. After a discussion with our developers, we decided to expose the specified types so that they can be imported directly from '@progress/kendo-angular-grid'.

The updated version of the Grid package should be available in our Development channel soon.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Mojtaba
Top achievements
Rank 1
answered on 13 Feb 2019, 12:14 PM

Thank you very much Dimiter,

Regards,

Mojtaba

Tags
Grid
Asked by
Mojtaba
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Mojtaba
Top achievements
Rank 1
Share this question
or