It is the type="data" format issue. If I remove the "format" attribute, it then leave only the first error.
What is this error mean?
For type="data" format issue, need to change
from:
format="dd-MM-yyyy"
to
:customFormat="{ type:'date', format:'dd-MM-yyyy'}"
However, for the issue "pdf-export.js?c2da:143 Uncaught (in promise)", I have really no idea.
Can please help?
The issue "pdf-export.js?c2da:143 Uncaught (in promise)" is due to the two footer at the bottom... Can I know how to fix this?
Ok, issue found. It is aggregate problem with custom template. Please help to suggest a fix. Thanks.
|
<template>
<div id="app">
<ejs-grid
:dataSource="data"
:allowPaging="true"
ref="grid"
:toolbar="toolbar"
:toolbarClick="toolbarClick"
:allowPdfExport="true"
:allowTextWrap="true"
:pageSettings="pageOption"
>
<e-columns>
<e-column field="OrderID" headerText="Order ID" width="150"></e-column>
. . .
></e-column>
</e-columns>
<e-aggregates>
<e-aggregate>
<e-columns>
<e-column
type="Sum"
field="Freight"
format="N2"
:footerTemplate="sumTemplate"
>
</e-column>
</e-columns>
</e-aggregate>
<e-aggregate>
<e-columns>
<e-column
type="Average"
field="Freight"
format="N2"
:footerTemplate="avgTemplate"
>
</e-column>
</e-columns>
</e-aggregate>
</e-aggregates>
</ejs-grid>
</div>
</template>
<script>
. . .
export default {
data: () => {
return {
data: data.slice(0, 16),
pageOption: { pageSize: 8 },
toolbar: ["PdfExport"],
sumTemplate: function () {
return {
template: Vue.component("sumTemplate", {
template: `<span>Sum: {{data.Sum}}</span>`,
data: function () {
return { data: { data: {} } };
},
}),
};
},
avgTemplate: function () {
return {
template: Vue.component("avgTemplate", {
template: `<span>Average: {{data.Average}}</span>`,
data: function () {
return { data: { data: {} } };
},
}),
};
},
};
},
methods: {
toolbarClick: function (args) {
if (args.item.text === "PDF Export") {
this.$refs.grid.pdfExport();
}
},
},
provide: {
grid: [Aggregate, Page, Toolbar, PdfExport],
},
};
</script>
<style>
</style> |