"syncfusion-javascript": "16.3.30"
"aurelia-syncfusion-bridge": "5.6.2",
import axios from "axios";
export class WebAPI {
async getList(){
let mydata = await axios.get('https://home.tenantcloud.com/v1/landlord/property');
return mydata.data.list;
}
}
<template>
<div>
<ej-grid e-data-source.bind="gridData" e-columns.bind="cols">
</ej-grid>
</div>
</template>
import axios from 'axios';
import {WebAPI} from '../../services/tentantCloudApi'
export class Test {
static inject = [WebAPI];
constructor(api) {
this.api = api;
this.gridData = [];
this.getdata();
}
async getdata() {
this.gridData = await this.api.getList();
console.log(this.gridData)
}
}
constructor(api) {
this.gridData = [];
this.getdata();
}
async getdata() {
setTimeout(function(){ // to indicate the time taken from api.
var id = $(".e-grid").attr("id"); // get the element id which has Grid.
$("#"+id).ejGrid("destroy");// Destriy the existing Grid
this.gridData = [{
OrderID: 10248, CustomerID: 'VINET', EmployeeID: 5, Verfied: false,
OrderDate: new Date(8364186e5), Freight: 32.38, name: {firstName: "Sans"}
},
. . . . . .
}];
$("#"+id).ejGrid({dataSource: this.gridData}); // re render the Grid with updated dataSource.
},1000)
}
}
|
<style>
#ejControl_0AlertDialog,#ejControl_0AlertDialog_wrapper,#ejControl_0AlertDialog_overLay{
display: none !important;
}
</style>
|