Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144595 | May 14,2019 05:13 AM UTC | May 15,2019 06:19 AM UTC | Vue | 4 |
![]() |
Tags: Data Grid |
<template>
<div id="app">
<ejs-grid ref='grid' id='grid' :dataSource="data" :allowPaging='true' :pageSettings='pageSettings' :editSettings='editSettings' :toolbar='toolbar'
:actionComplete="actionComplete">
<e-columns>
. . .
</e-columns>
</ejs-grid>
</div>
</template>
<script>
import Vue from "vue";
import { GridPlugin,Toolbar, Edit, Page } from "@syncfusion/ej2-vue-grids";
Vue.use(GridPlugin);
export default {
name: "App",
data: () => {
return {
data: data,
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Dialog' },
. . .
};
},
methods: {
actionComplete: function(e) {
if (e.requestType === "save") { //need to check e.requestType == “batchsave” for Batch editing
// you can do your code here
}
}
},
provide: {
grid: [Toolbar, Edit, Page]
}
};
</script>
|
<template>
<div id="app">
<ejs-grid ref='grid' id='grid' :dataSource="data" :allowPaging='true' :pageSettings='pageSettings' :editSettings='editSettings' :toolbar='toolbar'
:actionBegin="actionBegin">
<e-columns>
. . .
</e-columns>
</ejs-grid>
</div>
</template>
<script>
import Vue from "vue";
import { GridPlugin,Toolbar, Edit, Page } from "@syncfusion/ej2-vue-grids";
import { data } from './datasource.js';
Vue.use(GridPlugin);
export default {
. . .
methods: {
actionBegin: function(e) {
if (e.requestType === "save") {
console.log(e.form.querySelector("#gridCustomerID").value);
console.log("save");
console.log(e.rowData);
}
}
};
</script>
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.