Excel Exporter example in Angular

Our blazing fast Grid component built with pure JavaScript
Post Reply
User avatar
proteams-kaan
Posts: 12
Joined: Fri Jan 04, 2019 1:22 pm

Excel Exporter example in Angular

Post by proteams-kaan » Thu Jul 11, 2019 1:05 pm

Is it possible to give an example project setup for using ExcelExporter in angular?

I've added zipcelx.js to the scripts in angular.js file.
But no matter what I try for the ExcelExporter.umd.js I can't get it registered with the GridFeatureManager.

I'm using bryntum-grid as suggested via a local package reference in package.json to the build directory in the distribution.

Any help would be much appreciated.

Br,
Kaan.

User avatar
proteams-kaan
Posts: 12
Joined: Fri Jan 04, 2019 1:22 pm

Re: Excel Exporter example in Angular

Post by proteams-kaan » Tue Jul 16, 2019 7:00 am

Minor related issue: ExcelExporter relies on ObjectHelper. ObjectHelper is not exported in d.ts files

User avatar
proteams-kaan
Posts: 12
Joined: Fri Jan 04, 2019 1:22 pm

Re: Excel Exporter example in Angular

Post by proteams-kaan » Tue Jul 16, 2019 8:09 am

For what it's worth I've managed to get this working.

For anyone interested, the modifications I had to make are outlined here: https://gist.github.com/kaandok/e54f05e6f6639befae993c724e3818a0

I don't have any doubts about angular.json modification for zipcelx and registering the feature with the feature manager somewhere.

But I'd appreciate if someone from Bryntum team takes a look at ExcelExporter.ts and maybe comment on whether the additional field declarations are actually needed or even whether there is a more elegant way to achieve the results without creating a ts file?

It'd also be great if we could get the ObjectHelper declared properly in both grid.d.ts and grid.umd.d.ts files in build artifacts.

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2204
Joined: Fri Apr 01, 2016 11:08 am

Re: Excel Exporter example in Angular

Post by pmiklashevich » Tue Jul 16, 2019 10:16 am

Hello Kaan,

Sorry for the delay. I've fixed the d.ts file. ObjectHelper will be there in the next nightly build and next release. About copying ExcelExporter completely to create *.ts file, I don't think it's a good idea. It's better to have ExcelExporter.d.ts file and import it as is. Otherwise it will be hard to support the code base if we decide to change something in the sources. I've created a feature request for that: https://app.assembla.com/spaces/bryntum/tickets/8926-should-be-possible-to-use-excelexporter-with-typescript/details

Best,
Pavel
Pavel Miklashevich - Core Developer

Post Reply