BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<template>
<div>
<ejs-grid
ref="grid"
:columns="sourceColumns"
:dataSource="rows"
:allowGrouping="true"
:groupSettings="groupSettings"
:aggregates="aggregates"
/>
</div>
</template>
<script>
import Vue from "vue";
import {
GridPlugin,
Aggregate,
ExcelExport,
Group,
PdfExport,
Resize,
VirtualScroll
} from "@syncfusion/ej2-vue-grids";
Vue.use(GridPlugin);
export default {
name: "Grid",
data() {
return {
columns: [],
rows: [],
sourceColumns: [
{
field: "name",
headerText: "Name"
},
{
field: "location",
headerText: "Location"
},
{
field: "purchase",
headerText: "Purchase"
}
],
sourceRows: [
{
name: "John Doe",
location: "Paris",
purchase: 3
},
{
name: "John Doe",
location: "Paris",
purchase: 5
},
{
name: "John Doe",
location: "London",
purchase: 7
},
{
name: "Jane Doe",
location: "London",
purchase: 9
}
],
groupBy: ["name"],
aggregates: {
columns: []
}
};
},
computed: {
groupSettings() {
return {
showDropArea: false,
columns: this.groupBy
};
}
},
mounted() {
// it requires no time delay
//here you can change the columns and dataSource
this.columns = this.sourceColumns;
this.rows = this.sourceRows;
this.groupBy = ["location", "name"];
},
provide: {
grid: [Aggregate, ExcelExport, Group, PdfExport, Resize, VirtualScroll]
}
};
</script>
<style>
</style>
|