App.vue
<template>
<div class="col-lg-12 control-section">
<ejs-grid
ref="grid"
id="grid"
:dataSource="data"
:allowPaging="true"
:pageSettings="pageSettings"
>
<e-columns>
<e-column
field="OrderID"
headerText="Order ID"
width="120"
textAlign="Right"
:isPrimaryKey="true"
></e-column>
<e-column
field="Freight"
headerText="Freight"
width="120"
:format="{format:'C2', currency:'CHF' }"
textAlign="Right"
:isPrimaryKey="true"
></e-column>
<e-column field="ShipCountry" headerText="Ship Country" width="150"></e-column>
</e-columns>
</ejs-grid>
</div>
</template>
<script>
import Vue from "vue";
import { GridPlugin, Page } from "@syncfusion/ej2-vue-grids";
import { data } from "./data";
// refer the corresponding json files and load them using loadCldr method
import { loadCldr, setCulture, setCurrencyCode } from "@syncfusion/ej2-base";
import * as currencies from "./currencies.json";
import * as gregorian from "./ca-gregorian.json";
import * as numbers from "./numbers.json";
loadCldr(currencies, gregorian, numbers);
setCulture("sw");
setCurrencyCode("CHF");
Vue.use(GridPlugin);
export default Vue.extend({
data: () => {
return {
data: data.slice(0, 20),
pageSettings: { pageCount: 5 }
};
},
methods: {},
computed: {},
provide: {
grid: [Page]
}
});
</script> |