Hey,
is it possible to export as excel file within the vue integration?
The documentation is rly confusing me ...
This is my code (i'm just using the trial atm):
<template>
<div>
<button @click="download">Download</button>
<grid style="height: 500px"
ref="grid"
:columns="columns"
:data="data"
:searchFeature=true
:features="features"
></grid>
</div>
</template>
<script>
import zipcelx from 'zipcelx';
import Grid from 'bryntum-vue-grid-shared/src/Grid';
import { TableExporter } from 'bryntum-grid';
export default {
name: 'datatable',
components: {
Grid,
},
methods: {
download() {
const exporter = new TableExporter(this.features.excelExporter.exporterConfig);
exporter.export()
},
},
data() {
return {
features: {
filter: true,
excelExporter: {
zipcelx,
exporterConfig: {
target: this.$refs.grid,
columns: [
{ text: 'ID', field: 'id', width: 90 },
{ text: 'Erstellt am', field: 'created_at', width: 90 },
{ text: 'Punkte', field: 'points', width: 90 },
{ text: 'Land', field: 'country', width: 90 },
],
}
},
},
columns: [
{
field: 'id',
text: 'Id',
flex: 1,
},
{
field: 'created_at',
text: 'Erstellt am',
flex: 1,
},
{
field: 'points',
text: 'Punkte',
flex: 1,
},
{
field: 'country',
text: 'Land',
flex: 1,
},
{
field: 'dealer_number',
text: 'Hdl. Nr',
flex: 1,
},
{
field: 'dealer',
text: 'Händler',
flex: 1,
},
{
field: 'seller',
text: 'Verkäufer',
flex: 1,
},
{
field: 'mail',
text: 'E-Mail',
flex: 1,
},
{
field: 'attributes',
text: 'Indiv. Attribute',
flex: 1,
},
{
field: 'ab_number',
text: 'AB Nummer',
flex: 1,
},
{
field: 'vin',
text: 'VIN',
flex: 1,
},
{
field: 'type',
text: 'Typ',
flex: 1,
},
{
field: 'brand',
text: 'Marke',
flex: 1,
},
{
field: 'mnumber',
text: 'Modellklasse',
flex: 1,
},
{
field: 'm',
text: 'Modell',
flex: 1,
},
{
field: 'saison',
text: 'Saison',
flex: 1,
},
{
field: 'ad',
text: 'Auftragsdatum (KT)',
flex: 1,
},
{
field: 'handout',
text: 'geplanter Übergabetermin an Kunden',
flex: 1,
},
{
field: 'com',
text: 'Kommission / Beschreibung',
flex: 1,
},
{
field: 'z',
text: 'Zahlungsart',
flex: 1,
},
{
field: 'ka',
text: 'Kundenart',
flex: 1,
},
{
field: 'reason',
text: 'Grund',
flex: 1,
},
],
}
},
computed: {
data() {
let _data = [];
let i;
for (i = 1; i <= 3216; i++) {
_data.push(
{
id: i,
created_at: '03.08.20',
points: 450,
country: 'DE',
dealer_number: 10000,
dealer: 'a',
seller: 'b',
mail: 'a@a.de',
attributes: 'Attribute 1, Attribute 2',
ab_number: '1234567',
vin: 'ABCDEFG123456789',
type: 'RM',
brand: 'Brand',
mnumber: '[tbc]',
m: 'Modell',
saison: '2010',
ad: '28.10.19',
handout: '07.08.20',
com: '',
z: 'Bar',
ka: 'Unternehmen',
reason: '',
},
);
}
return _data;
}
},
}
</script>
Edit:
Btw. this i the error which occurs:
Thank you.