안녕하세요, 그리드 그룹 질문드립니다.
위 주소에서 다음의 소스로 테스트를 했습니다.
<template>
<div class="container-fluid">
<wj-flex-grid
:itemsSource="data"
:initialized="initializedGrid">
</wj-flex-grid>
</div>
</template>
<script>
import "@grapecity/wijmo.styles/wijmo.css";
import "bootstrap.css";
import Vue from "vue";
import '@grapecity/wijmo.touch'; // support drag/drop on touch devices
import "@grapecity/wijmo.vue2.grid";
import "@grapecity/wijmo.vue2.grid.filter";
import { CollectionView, PropertyGroupDescription, SortDescription } from "@grapecity/wijmo";
import "@grapecity/wijmo.vue2.grid.grouppanel";
import "@grapecity/wijmo.vue2.input"; // for the menu
let App = Vue.extend({
name: "app",
data: function() {
return {
data: new CollectionView(this.getData(), {
groupDescriptions: ['country']
}),
grid: null,
groupIndex: -1,
};
},
methods: {
// save references to the controls
initializedGrid: function(grid) {
this.grid = grid;
},
// create some random data
getData: function() {
let countries = "US,Germany,UK,Japan,Italy,Greece".split(","),
products = "Phones,Computers,Cameras,Stereos".split(","),
data = [];
for (let i = 0; i < 200; i++) {
data.push({
id: i,
country: countries[i % countries.length],
product: products[i % products.length],
downloads: Math.round(100 + Math.random() * 10000),
sales: Math.random() * 10000,
expenses: Math.random() * 5000
});
}
return data;
}
}
});
new Vue({ render: h => h(App) }).$mount("#app");
</script>
<style>
.wj-flexgrid {
max-height: 250px;
margin: 10px 0;
}
.wj-dropdown-panel.ctx-menu {
background: rgb(221, 250, 255);
padding: 1em;
}
.wj-dropdown-panel.ctx-menu span {
margin-right: 0.5em;
opacity: 0.5;
}
body {
margin-bottom: 20px;
}
</style>