Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149273 | Nov 20,2019 11:05 AM UTC | Nov 26,2019 01:27 PM UTC | Vue | 5 |
![]() |
Tags: Data Grid |
<template>
<div id="app">
<ejs-grid
. . . .
:actionBegin="actionBegin"
:actionComplete="actionComplete"
:toolbar="toolbar"
height="273px"
>
<e-columns>
<e-column
field="OrderID"
headerText="Order ID"
textAlign="Right"
:isPrimaryKey="true"
width="100"
></e-column>
<e-column field="CustomerID" headerText="Customer ID" width="120"></e-column>
<e-column field="ShipCountry" headerText="Ship Country" width="150"></e-column>
</e-columns>
</ejs-grid>
</div>
</template>
<script>
. . . .
export default {
data() {
return {
data: data,
. . . .
template: function() {
return { template: DialogTemplate };
}
},
},
methods: {
actionBegin(args) {
if (args.requestType === "save") {
// cast string to integer value.
args.data["Freight"] = parseFloat(
args.form.querySelector("#Freight").value
);
}
},
actionComplete(args) {
// Set initail Focus
if (args.requestType === "beginEdit") {
args.form.elements.namedItem("CustomerName").focus();
}
}
}
};
</script> |
<template>
<div id="dialogTemplate">
<ejs-tab id="element">
<e-tabitems>
<e-tabitem :header="headerText0" content="#general"></e-tabitem>
<e-tabitem :header="headerText1" content="#seo"></e-tabitem>
</e-tabitems>
</ejs-tab>
<div id="general">
. . .
</div>
<div id="seo" style="display: none">
. . . . .
</div>
</div>
</template>
<script>
import Vue from "vue";
import { data } from "./data";
import { DataUtil } from "@syncfusion/ej2-data";
import { TabPlugin } from "@syncfusion/ej2-vue-navigations";
Vue.use(TabPlugin);
export default {
data() {
let shipCity = DataUtil.distinct(data, "ShipCity", true);
let shipCountry = DataUtil.distinct(data, "ShipCity", true);
return {
data: {},
shipCityDistinctData: shipCountry,
shipCountryDistinctData: shipCountry,
headerText0: { text: "Edit/Add" },
headerText1: { text: "JavaScript" }
};
}
</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.