|
export let employeeData = [
{
ParentArrayChildRecords: [
{ EmployeeID: 1, childProp: "text", childProp2: "text2" },
{ EmployeeID: 2, childProp: "text", childProp2: "text2" },
. . . . . . .
],
EmployeeID: 1,
LastName: "Davolio",
.. . . . . .
},
{
EmployeeID: 2,
ParentArrayChildRecords: [
{ EmployeeID: 1, childProp: "text", childProp2: "text2" },
{ EmployeeID: 2, childProp: "text", childProp2: "text2" },
. . . . . . .
],
LastName: "Fuller",
FirstName: "Andrew",
. . . . . .
}]
<template>
<div class="col-lg-12 control-section">
<div>
<ejs-grid
:dataSource="parentData"
:childGrid="childGrid"
:allowSorting="true"
:detailDataBound="detailDataBound"
>
<e-columns>
. . . . . . . . . .
</e-columns>
</ejs-grid>
</div>
</div>
</template>
<script>
. . . . . . . . . . . . . . .
export default Vue.extend({
data: () => {
return {
parentData: employeeData.slice(0, 5),
childGrid: {
queryString: "EmployeeID",
. . . . . .
columns: [
{
field: "EmployeeID",
headerText: "Order ID",
textAlign: "Right",
width: 120,
},
{ field: "childProp", headerText: "Child Prop", width: 120 },
{ field: "childProp2", headerText: "Child Prop2", width: 120 },
],
},
methods: {
detailDataBound: function (args) {
args.childGrid.dataSource = args.data.ParentArrayChildRecords;
},
};
},
});
</script>
|