Hi-- This may be a very dumb question but I have always used remote data and now I'm trying to attach to a local data source and am having trouble with the syntax for some reason. Can you provide a link to your actual
import { data } from './datasource.js';
so I can validate the structure on the datasource.js page? For some reason I can't bind correctly and I want to
eliminate all steps.
It's aways after I ask a question-- I found what I needed.
https://ej2.syncfusion.com/vue/documentation/grid/data-binding/#local-data
Thanks
<template>
<div id="app">
<ejs-grid :dataSource="data" height="315px">
. . . . . . . . .
</ejs-grid>
</div>
</template>
<script>
import Vue from "vue";
import { GridPlugin } from "@syncfusion/ej2-vue-grids";
import { data } from "./datasource.js";
Vue.use(GridPlugin);
export default {
data() {
return {
data: data,
};
},
};
</script>
<style>
@import "https://cdn.syncfusion.com/ej2/material.css";
</style>
[datasoucre.js]
exports.data = [
{
OrderID: 10248,
CustomerID: "VINET",
EmployeeID: 5,
OrderDate: new Date(8364186e5),
ShipName: "Vins et alcools Chevalier",
ShipCity: "Reims",
ShipAddress: "59 rue de l Abbaye",
ShipRegion: "CJ",
ShipPostalCode: "51100",
ShipCountry: "France",
Freight: 32.38,
Verified: !0
},
. . . . . . . . . . . . .
{
OrderID: 10262,
CustomerID: "RATTC",
EmployeeID: 8,
OrderDate: new Date(8379738e5),
ShipName: "Rattlesnake Canyon Grocery",
ShipCity: "Albuquerque",
ShipAddress: "2817 Milton Dr.",
ShipRegion: "NM",
ShipPostalCode: "87110",
ShipCountry: "USA",
Freight: 48.29,
Verified: !0
}];
|