methods 안에 정의한 함수를 의미했습니다.
<template>
<div class="container-fluid">
<wj-flex-grid
:alternatingRowStep="0"
selectionMode="MultiRange"
:itemsSource="data"
>
<wj-flex-grid-column
binding="id"
header="ID"
:width="80"
:isReadOnly="true"
/>
<wj-flex-grid-column
binding="country"
header="Country"
:editor="editors.countryCombo"
/>
</wj-flex-grid>
</div>
</template>
<script>
import "@grapecity/wijmo.styles/wijmo.css";
// import "bootstrap.css";
import Vue from "vue";
import * as wjCore from "@grapecity/wijmo";
import { ComboBox } from "@grapecity/wijmo.input";
import "@grapecity/wijmo.vue2.input";
import "@grapecity/wijmo.vue2.grid";
wjCore.setLicenseKey(window.evalkey);
export default {
name: "app",
data: function () {
return {
testdata: "aa",
data: _getData(),
grid: null,
countries: getCountries(),
editors: {
countryCombo: new ComboBox(document.createElement("div"), {
itemsSource: getCountries(),
selectedIndexChanged: function (s, e) {
console.log(1);
this.getSelectedIndexChanged();
},
textChanged: function (s, e) {
console.log(2);
gettextChanged();
},
}),
},
};
},
computed: {},
methods: {
getSelectedIndexChanged() {
console.log("getSelectedIndexChanged");
},
},
};
function getCountries() {
return "US,Germany,UK,Japan,Italy,Greece".split(",");
}
function _getData() {
// create an array with 100 data items
let countries = getCountries();
let products = "Piano,Violin,Flute,Guitar,Cello".split(",");
let data = [];
for (let i = 0; i < 20; i++) {
data.push({
id: i,
sel: false,
country: countries[i % countries.length],
product: products[i % products.length],
sales: Math.random() * 10000,
expenses: Math.random() * 5000,
});
}
// create a paged CollectionView with 6 data items per page
return new wjCore.CollectionView(data);
}
function gettextChanged() {
console.log("gettextChanged");
}
</script>
<style>
.wj-flexgrid {
height: 300px;
margin: 10px;
}
body {
margin: 10px;
}
</style>