|
| 1 | +<template> |
| 2 | + <ejs-treegrid :dataSource="data" |
| 3 | + childMapping="subtasks" |
| 4 | + :treeColumnIndex="1" |
| 5 | + :height='400' |
| 6 | + :allowFiltering="true" |
| 7 | + :filterSettings="filterOptions" |
| 8 | + :allowPaging='true' |
| 9 | + :pageSettings='pageSettings'> |
| 10 | + <e-columns> |
| 11 | + <e-column field='taskID' headerText='Task ID' width='80' textAlign='Right'></e-column> |
| 12 | + <e-column field='taskName' headerText='Task Name' width='190'></e-column> |
| 13 | + <e-column field='startDate' headerText='Start Date' width='100' format="yMd" textAlign='Right'></e-column> |
| 14 | + <e-column field='duration' headerText='Duration' width='90' textAlign='Right'></e-column> |
| 15 | + <e-column field='progress' headerText='Progress' width='90' textAlign='Right'></e-column> |
| 16 | + </e-columns> |
| 17 | + </ejs-treegrid> |
| 18 | +</template> |
| 19 | + |
| 20 | +<script> |
| 21 | +import { TreeGridComponent, ColumnsDirective, ColumnDirective, Page, Filter} from "@syncfusion/ej2-vue-treegrid"; |
| 22 | +import {sampleData} from './data.js'; |
| 23 | +
|
| 24 | +export default{ |
| 25 | + name: 'App', |
| 26 | + components: { |
| 27 | + 'ejs-treegrid': TreeGridComponent, |
| 28 | + 'e-columns': ColumnsDirective, |
| 29 | + 'e-column': ColumnDirective |
| 30 | + }, |
| 31 | + data: () => { |
| 32 | + return { |
| 33 | + data: sampleData, |
| 34 | + filterOptions: { |
| 35 | + ignoreAccent:true, |
| 36 | + hierarchyMode:"None", |
| 37 | + type: "Excel", |
| 38 | + // Uncomment below code for initial filtering |
| 39 | + // columns:[{ |
| 40 | + // field: "taskName", |
| 41 | + // matchCase: false, |
| 42 | + // operator: "startswith", |
| 43 | + // predicate: "and", |
| 44 | + // value: "plan" |
| 45 | + // }] |
| 46 | + }, |
| 47 | + pageSettings: { pageSize: 12 } |
| 48 | + } |
| 49 | + }, |
| 50 | + provide:{ |
| 51 | + treegrid:[Page, Filter] |
| 52 | + } |
| 53 | +} |
| 54 | +</script> |
| 55 | + |
| 56 | +<style> |
| 57 | + @import "../node_modules/@syncfusion/ej2-base/styles/material.css"; |
| 58 | + @import "../node_modules/@syncfusion/ej2-buttons/styles/material.css"; |
| 59 | + @import "../node_modules/@syncfusion/ej2-calendars/styles/material.css"; |
| 60 | + @import "../node_modules/@syncfusion/ej2-dropdowns/styles/material.css"; |
| 61 | + @import "../node_modules/@syncfusion/ej2-inputs/styles/material.css"; |
| 62 | + @import "../node_modules/@syncfusion/ej2-navigations/styles/material.css"; |
| 63 | + @import "../node_modules/@syncfusion/ej2-popups/styles/material.css"; |
| 64 | + @import "../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css"; |
| 65 | + @import "../node_modules/@syncfusion/ej2-vue-grids/styles/material.css"; |
| 66 | + @import "../node_modules/@syncfusion/ej2-vue-treegrid/styles/material.css"; |
| 67 | +</style> |
0 commit comments