<template>
<div class="col-lg-12 control-section">
<div>
<ejs-grid
ref="grid"
id="transaction_grid"
:dataSource="data"
height="300"
:allowPaging="true"
:selectionSettings="selectionOptions"
:dataStateChange="dataStateChange"
>
<e-columns>
<e-column field="checkBox" type="checkbox" width="130"></e-column>
<e-column
field="OrderID"
headerText="Order ID"
width="130"
:isPrimaryKey="true"
textAlign="Right"
></e-column>
--------
</e-columns>
</ejs-grid>
</div>
</div>
</template>
<script>
-------
export default Vue.extend({
data() {
return {
data: {},
selectionOptions: { persistSelection: true },
orderService: new OrderService(),
};
},
mounted() {
// Used vue mounted hook to provide dataSource to Grid and handled the initial paging
let state = { skip: 0, take: 12 };
this.dataStateChange(state);
},
methods: {
dataStateChange: function (state) {
// Handled the other Grid actions like paging, sorting etc.. by using dataState change event
this.orderService.execute(state).then((gridData) => {
this.data = gridData;
});
},
},
------
});
</script>
|