|
<template>
<div id="app">
<ejs-grid
id="Grid"
ref="grid"
:dataSource="data"
:allowPaging="true"
:allowGrouping="true"
:groupSettings="groupSettings"
:allowExcelExport="true"
:allowPdfExport="true"
:exportGroupCaption="exportGroupCaption"
>
<e-columns>
. . . . . . .
. . . . . . .
</e-columns>
</ejs-grid>
<div @click="exportExcel" class="export-buttonone">Export to Excel</div>
<div @click="exportPdf" class="export-buttontwo">Export to PDF</div>
<div @click="print" class="export-buttonthree">Print</div>
</div>
</template>
<script>
import Vue from "vue";
import {
GridPlugin,
Aggregate,
Group,
Page,
PdfExport,
ExcelExport,
} from "@syncfusion/ej2-vue-grids";
import { data } from "./datasource";
Vue.use(GridPlugin);
export default {
data() {
return {
data: data.slice(0, 7),
groupSettings: {
captionTemplate: "<div>${format(data)}</div> ",
columns: ["CustomerID"],
},
};
},
provide: {
grid: [Page, Aggregate, Group, PdfExport, ExcelExport],
},
methods: {
exportGroupCaption: function (args) {
// here you can customize the groupcaption text as per your requirement
args.captionText = "Customized template: " + args.captionText;
}}
</script> |