Search results

TreeGridModel API in Vue TreeGrid API component

Interface for a class TreeGrid

Properties

actionBegin

EmitType<PageEventArgs|FilterEventArgs|SortEventArgs|SearchEventArgs|AddEventArgs|SaveEventArgs|EditEventArgs|DeleteEventArgs>

Triggers when TreeGrid actions such as sorting, filtering, paging etc., starts.

actionComplete

EmitType<PageEventArgs|FilterEventArgs|SortEventArgs|SearchEventArgs|AddEventArgs|SaveEventArgs|EditEventArgs|DeleteEventArgs>

Triggers when TreeGrid actions such as sorting, filtering, paging etc. are completed.

actionFailure

EmitType<FailureEventArgs>

Triggers when any TreeGrid action failed to achieve the desired results.

batchAdd

EmitType<BatchAddArgs>

Triggers when records are added in batch mode.

batchCancel

EmitType<BatchCancelArgs>

Triggers before records are added in batch mode.

batchDelete

EmitType<BatchDeleteArgs>

Triggers when records are deleted in batch mode.

beforeBatchAdd

EmitType<BeforeBatchAddArgs>

Triggers before records are added in batch mode.

beforeBatchDelete

EmitType<BeforeBatchDeleteArgs>

Triggers before records are deleted in batch mode.

beforeBatchSave

EmitType<BeforeBatchSaveArgs>

Triggers before records are saved in batch mode.

beforeCopy

EmitType<BeforeCopyEventArgs>

Triggers before TreeGrid copy action.

beforeDataBound

EmitType<BeforeDataBoundArgs>

Triggers before data is bound to Tree Grid.

beforeExcelExport

EmitType<Object>

Triggers before TreeGrid data is exported to Excel file.

beforePaste

EmitType<BeforePasteEventArgs>

Triggers before TreeGrid paste action.

beforePdfExport

EmitType<Object>

Triggers before TreeGrid data is exported to PDF document.

beforePrint

EmitType<PrintEventArgs>

Triggers before the print action starts.

beginEdit

EmitType<BeginEditArgs>

Triggers before the record is to be edit.

cellDeselected

EmitType<CellDeselectEventArgs>

Triggers when a particular selected cell is deselected.

cellDeselecting

EmitType<CellDeselectEventArgs>

Triggers before the selected cell is deselecting.

cellEdit

EmitType<CellEditArgs>

Triggers when the cell is being edited.

cellSave

EmitType<CellSaveArgs>

Triggers when cell is saved.

cellSaved

EmitType<CellSaveArgs>

Triggers when cell is saved.

cellSelected

EmitType<CellSelectEventArgs>

Triggers after a cell is selected.

cellSelecting

EmitType<CellSelectingEventArgs>

Triggers before any cell selection occurs.

checkboxChange

EmitType<CheckBoxChangeEventArgs>

Triggers when the check box state change in checkbox column.

collapsed

EmitType<RowCollapsedEventArgs>

Triggers after the record is collapsed.

collapsing

EmitType<RowCollapsingEventArgs>

Triggers while collapsing the TreeGrid record

columnDrag

EmitType<ColumnDragEventArgs>

Triggers when column header element is dragged (moved) continuously.

columnDragStart

EmitType<ColumnDragEventArgs>

Triggers when column header element drag (move) starts.

columnDrop

EmitType<ColumnDragEventArgs>

Triggers when a column header element is dropped on the target column.

columnMenuClick

EmitType<MenuEventArgs>

Triggers when click on column menu.

columnMenuOpen

EmitType<ColumnMenuOpenEventArgs>

Triggers before column menu opens.

contextMenuClick

EmitType<MenuEventArgs>

Triggers when click on context menu.

contextMenuOpen

EmitType<BeforeOpenCloseMenuEventArgs>

Triggers before context menu opens.

created

EmitType<Object>

Triggers when the component is created.

dataBound

EmitType<Object>

Triggers when data source is populated in the TreeGrid.

dataSourceChanged

EmitType<DataSourceChangedEventArgs>

Triggers when the TreeGrid data is added, deleted and updated. Invoke the done method from the argument to start render after edit operation.

dataStateChange

EmitType<DataStateChangeEventArgs>

Triggers when the TreeGrid actions such as Sorting, Paging etc., are done. In this event,the current view data and total record count should be assigned to the dataSource based on the action performed.

detailDataBound

EmitType<DetailDataBoundEventArgs>

Triggers after detail row expands.

This event triggers at initial expand.

excelExportComplete

EmitType<ExcelExportCompleteArgs>

Triggers after TreeGrid data is exported to Excel file.

excelHeaderQueryCellInfo

EmitType<ExcelHeaderQueryCellInfoEventArgs>

Triggers before exporting each header cell to Excel file. You can also customize the Excel cells.

excelQueryCellInfo

EmitType<ExcelQueryCellInfoEventArgs>

Triggers before exporting each cell to Excel file. You can also customize the Excel cells.

expanded

EmitType<RowExpandedEventArgs>

Triggers after the record is expanded

expanding

EmitType<RowExpandingEventArgs>

Triggers while expanding the TreeGrid record

headerCellInfo

EmitType<HeaderCellInfoEventArgs>

Triggered for stacked header.

load

EmitType<Object>

This event allows customization of TreeGrid properties before rendering.

pdfExportComplete

EmitType<PdfExportCompleteArgs>

Triggers after TreeGrid data is exported to PDF document.

pdfHeaderQueryCellInfo

EmitType<PdfHeaderQueryCellInfoEventArgs>

Triggers before exporting each header cell to PDF document. You can also customize the PDF cells.

pdfQueryCellInfo

EmitType<PdfQueryCellInfoEventArgs>

Triggers before exporting each cell to PDF document. You can also customize the PDF cells.

printComplete

EmitType<PrintEventArgs>

Triggers after print action is completed.

queryCellInfo

EmitType<QueryCellInfoEventArgs>

Triggered every time a request is made to access cell information, element, or data. This will be triggered before the cell element is appended to the TreeGrid element.

recordDoubleClick

EmitType<RecordDoubleClickEventArgs>

Triggers when record is double clicked.

resizeStart

EmitType<ResizeArgs>

Triggers when column resize starts.

resizeStop

EmitType<ResizeArgs>

Triggers when column resize ends.

resizing

EmitType<ResizeArgs>

Triggers on column resizing.

rowDataBound

EmitType<RowDataBoundEventArgs>

Triggered every time a request is made to access row information, element, or data. This will be triggered before the row element is appended to the TreeGrid element.

rowDeselected

EmitType<RowDeselectEventArgs>

Triggers when a selected row is deselected.

rowDeselecting

EmitType<RowDeselectEventArgs>

Triggers before deselecting the selected row.

rowDrag

EmitType<RowDragEventArgs>

Triggers when row elements are dragged (moved) continuously.

rowDragStart

EmitType<RowDragEventArgs>

Triggers when row element’s drag(move) starts.

rowDragStartHelper

EmitType<RowDragEventArgs>

Triggers when row element’s before drag(move).

rowDrop

EmitType<RowDragEventArgs>

Triggers when row elements are dropped on the target row.

rowSelected

EmitType<RowSelectEventArgs>

Triggers after a row is selected.

rowSelecting

EmitType<RowSelectingEventArgs>

Triggers before row selection occurs.

toolbarClick

EmitType<ClickEventArgs>

Triggers when toolbar item is clicked.

aggregates

AggregateRowModel[]

Configures the TreeGrid aggregate rows.

Check the Aggregates for its configuration.

allowExcelExport

boolean

If allowExcelExport set to true, then it will allow the user to export treegrid to Excel file.

Check the ExcelExport to configure exporting document.

allowFiltering

boolean

If allowFiltering is set to true the filter bar will be displayed. If set to false the filter bar will not be displayed. Filter bar allows the user to filter tree grid records with required criteria.

allowMultiSorting

boolean

If allowMultiSorting set to true, then it will allow the user to sort multiple column in the treegrid.

allowSorting should be true.

allowPaging

boolean

If allowPaging is set to true, pager renders.

allowPdfExport

boolean

If allowPdfExport set to true, then it will allow the user to export treegrid to Pdf file.

Check the Pdfexport to configure the exporting document.

allowReordering

boolean

If allowReordering is set to true, TreeGrid columns can be reordered. Reordering can be done by drag and drop of a particular column from one index to another index.

If TreeGrid is rendered with stacked headers, reordering is allowed only at the same level as the column headers.

allowResizing

boolean

If allowResizing is set to true, TreeGrid columns can be resized.

allowRowDragAndDrop

boolean

If allowRowDragAndDrop is set to true, you can drag and drop treegrid rows at another treegrid.

allowSelection

boolean

If allowSelection is set to true, it allows selection of (highlight row) TreeGrid records by clicking it.

allowSorting

boolean

If allowSorting is set to true, it allows sorting of treegrid records when column header is clicked.

allowTextWrap

boolean

If allowTextWrap set to true, then text content will wrap to the next line when its text content exceeds the width of the Column Cells.

autoCheckHierarchy

boolean

If autoCheckHierarchy is set to true, hierarchy checkbox selection is enabled in TreeGrid.

childMapping

string

Specifies the mapping property path for child records in data source

<template>
  <div>
    <ejs-treegrid :dataSource='data' childMapping='subtasks' :treeColumnIndex='1'>
    </ejs-treegrid>
  </div>
</template>
<script>
import Vue from "vue";
import { TreeGridPlugin } from "@syncfusion/ej2-vue-treegrid";
Vue.use(TreeGridPlugin);
export default {
  data: function() {
    return {
      data: sampleData
    };
  }
};
</script>

clipMode

ClipMode

Defines the mode of clip. The available modes are,

* Clip :- Truncates the cell content when it overflows its area.
* Ellipsis :- Displays ellipsis when the cell content overflows its area.
* EllipsisWithTooltip :- Displays ellipsis when the cell content overflows its area,

also it will display the tooltip while hover on ellipsis is applied.

columnMenuItems

ColumnMenuItem[] | ColumnMenuItemModel[]

columnMenuItems defines both built-in and custom column menu items.

The available built-in items are,

  • AutoFitAll - Auto fit the size of all columns.
  • AutoFit - Auto fit the current column.
  • SortAscending - Sort the current column in ascending order.
  • SortDescending - Sort the current column in descending order.
  • Filter - Filter options will show based on filterSettings property like filterbar, menu filter.

columnQueryMode

ColumnQueryModeType

columnQueryModeprovides options to retrieves data from the data source.Their types are

  • All: It retrieves whole data source.
  • Schema: retrieves data for all the defined columns in TreeGrid from the data source.
  • ExcludeHidden: retrieves data only for visible columns of TreeGrid from the data Source.

columns

ColumnModel[] | string[] | Column[]

Defines the schema of dataSource. If the columns declaration is empty or undefined then the columns are automatically generated from data source.

<template>
  <div>
    <ejs-treegrid :dataSource='data' childMapping='subtasks' :treeColumnIndex='1'>
        <e-columns>
          <e-column field='taskID' headerText='Task ID' width='70' textAlign='Right'></e-column>
          <e-column field='taskName' headerText='Task Name' width='200'></e-column>
          <e-column field='duration' headerText='Duration' width='80' textAlign='Right'></e-column>
          <e-column field='progress' headerText='Progress' width='80' textAlign='Right'></e-column>
        </e-columns>
    </ejs-treegrid>
  </div>
</template>
<script>
import Vue from "vue";
import { TreeGridPlugin } from "@syncfusion/ej2-vue-treegrid";
Vue.use(TreeGridPlugin);
export default {
  data: function() {
    return {
      data: sampleData
    };
  }
};
</script>

contextMenuItems

ContextMenuItem[] | ContextMenuItemModel[]

contextMenuItems defines both built-in and custom context menu items.

The available built-in items are,

  • AutoFitAll - Auto fit the size of all columns.
  • AutoFit - Auto fit the current column.
  • Edit - Edit the current record.
  • Delete - Delete the current record.
  • Save - Save the edited record.
  • Cancel - Cancel the edited state.
  • PdfExport - Export the grid as Pdf format.
  • ExcelExport - Export the grid as Excel format.
  • CsvExport - Export the grid as CSV format.
  • SortAscending - Sort the current column in ascending order.
  • SortDescending - Sort the current column in descending order.
  • FirstPage - Go to the first page.
  • PrevPage - Go to the previous page.
  • LastPage - Go to the last page.
  • NextPage - Go to the next page.

copyHierarchyMode

CopyHierarchyType

copyHierarchyMode Defines the copy clipboard types.

The available built-in items are,

  • Parent - Copy the selected data with parent record.
  • Child - Copy the selected data with child record.
  • Both - Copy the selected data with both parent and child record.
  • None - Copy only the selected record.

dataSource

Object | DataManager

It is used to render TreeGrid table rows.

<template>
  <div>
    <ejs-treegrid :dataSource='data' childMapping='subtasks' :treeColumnIndex='1'>
    </ejs-treegrid>
  </div>
</template>
<script>
import Vue from "vue";
import { TreeGridPlugin } from "@syncfusion/ej2-vue-treegrid";
import { sampleData } from "./data-source";
Vue.use(TreeGridPlugin);
export default {
  data: function() {
    return {
      data: sampleData
    };
  }
};
</script>

detailTemplate

string | Function

The detail template allows you to show or hide additional information about a particular row.

It accepts either the template string or the HTML element ID.

editSettings

EditSettingsModel

Configures the edit settings.

enableAdaptiveUI

boolean

If enableAdaptiveUI is set to true, the pop-up UI will become adaptive to small screens, and be used for filtering and other features.

<div id='treegrid'></div>
<script>
 var treegridObj = new TreeGrid({ enableAdaptiveUI: true });
 treegridObj.appendTo('#treegrid');
</script>

enableAltRow

boolean

If enableAltRow is set to true, the TreeGrid will render with e-altrow CSS class to the alternative tr elements.

Check the AltRow to customize the styles of alternative rows.

enableAutoFill

boolean

If enableAutoFill is set to true, then the auto fill icon will displayed on cell selection for copy cells. It requires the selection mode to be Cell and cellSelectionMode to be Box.

enableCollapseAll

boolean

Specifies whether to load all the rows in collapsed state when the TreeGrid is rendered for the first time.

enableColumnVirtualization

boolean

If enableColumnVirtualization set to true, then the Tree Grid will render only the columns visible within the view-port and load subsequent columns on horizontal scrolling. This helps to load large dataset of columns in Tree Grid.

enableHover

boolean

If enableHover is set to true, the row hover is enabled in the TreeGrid.

enableHtmlSanitizer

boolean

Specifies whether to display or remove the untrusted HTML values in the TreeGrid component. By default enableHtmlSanitizer is set to true, and it sanitizes any suspected untrusted strings and scripts before rendering them.

enableImmutableMode

boolean

If enableImmutableMode is set to true, the TreeGrid will reuse old rows if it exists in the new result instead of full refresh while performing the TreeGrid actions.

enableInfiniteScrolling

boolean

If enableInfiniteScrolling set to true, then the data will be loaded in TreeGrid when the scrollbar reaches the end. This helps to load large dataset in TreeGrid.

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads.

enableRtl

boolean

Enable or disable rendering component in right to left direction.

enableVirtualMaskRow

boolean

Specifies whether to display shimmer effect during scrolling action in virtual scrolling feature. If disabled, spinner is shown instead of shimmer effect.

enableVirtualization

boolean

If enableVirtualization set to true, then the TreeGrid will render only the rows visible within the view-port and load subsequent rows on vertical scrolling. This helps to load large dataset in TreeGrid.

expandStateMapping

string

Specifies the mapping property path for the expand status of a record in data source.

filterSettings

FilterSettingsModel

Configures the filter settings of the TreeGrid.

frozenColumns

number

Gets or sets the number of frozen columns.

frozenRows

number

Gets or sets the number of frozen rows.

gridLines

GridLine

Defines the mode of TreeGrid lines. The available modes are,

* Both :- Displays both horizontal and vertical TreeGrid lines.
* None :- No TreeGrid lines are displayed.
* Horizontal :- Displays the horizontal TreeGrid lines only.
* Vertical :- Displays the vertical TreeGrid lines only.
* Default :- Displays TreeGrid lines based on the theme.

hasChildMapping

string

Specifies whether record is parent or not for the remote data binding

height

string | number

Defines the scrollable height of the TreeGrid content.

idMapping

string

Specifies the name of the field in the dataSource, which contains the id of that row.

<template>
  <div>
    <ejs-treegrid :dataSource='data' idMapping='taskID' parentIdMapping='parentID' :treeColumnIndex='1'>
    </ejs-treegrid>
  </div>
</template>
<script>
import Vue from "vue";
import { TreeGridPlugin } from "@syncfusion/ej2-vue-treegrid";
Vue.use(TreeGridPlugin);
export default {
  data: function() {
    return {
      data: sampleData
    };
  }
};
</script>

infiniteScrollSettings

InfiniteScrollSettingsModel

Configures the infinite scroll settings.

loadChildOnDemand

boolean

If loadChildOnDemand is enabled, parent records are render in expanded state.

loadingIndicator

LoadingIndicatorModel

Configures the loading indicator of the Tree Grid. Specifies whether to display spinner or shimmer effect during the waiting time on any actions (paging, sorting, filtering, CRUD operations) performed in Tree Grid.

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

pageSettings

PageSettingsModel

Configures the pager in the TreeGrid.

parentIdMapping

string

Specifies the name of the field in the dataSource, which contains the parent’s id

<template>
  <div>
    <ejs-treegrid :dataSource='data' idMapping='taskID' parentIdMapping='parentID' :treeColumnIndex='1'>
    </ejs-treegrid>
  </div>
</template>
<script>
import Vue from "vue";
import { TreeGridPlugin } from "@syncfusion/ej2-vue-treegrid";
Vue.use(TreeGridPlugin);
export default {
  data: function() {
    return {
      data: sampleData
    };
  }
};
</script>

printMode

PrintMode

Defines the print modes. The available print modes are

* AllPages :- Prints all pages of the TreeGrid.
* CurrentPage :- Prints the current page of the TreeGrid.

query

Query

Defines the external Query that will be executed along with data processing.

rowDropSettings

RowDropSettingsModel

Configures the row drop settings of the TreeGrid.

rowHeight

number

Defines the height of TreeGrid rows.

rowTemplate

string | Function

The row template that renders customized rows from the given template. By default, TreeGrid renders a table row for every data source item.

searchSettings

SearchSettingsModel

Configures the search settings of the TreeGrid.

selectedRowIndex

number

The selectedRowIndex allows you to select a row at initial rendering. You can also get the currently selected row index.

selectionSettings

SelectionSettingsModel

Configures the selection settings.

showColumnChooser

boolean

If showColumnChooser is set to true, it allows you to dynamically show or hide columns.

showColumnMenu

boolean

If showColumnMenu set to true, then it will enable the column menu options in each columns.

Check the Column menu for its configuration.

sortSettings

SortSettingsModel

Configures the sort settings of the TreeGrid.

textWrapSettings

TextWrapSettingsModel

Configures the text wrap in the TreeGrid.

toolbar

[]

toolbar defines the ToolBar items of the TreeGrid. It contains built-in and custom toolbar items. If a string value is assigned to the toolbar option, it is considered as the template for the whole TreeGrid ToolBar. If an array value is assigned, it is considered as the list of built-in and custom toolbar items in the TreeGrid’s Toolbar.

The available built-in ToolBar items are:

  • Search: Searches records by the given key.
  • ExpandAll: Expands all the rows in TreeGrid
  • CollapseAll: Collapses all the rows in TreeGrid
  • ExcelExport - Export the TreeGrid to Excel(excelExport() method manually to make export.)
  • PdfExport - Export the TreeGrid to PDF(pdfExport() method manually to make export.)
  • CsvExport - Export the TreeGrid to CSV(csvExport() method manually to make export.)

    The following code example implements the custom toolbar items.

treeColumnIndex

number

Specifies the index of the column that needs to have the expander button.

width

string | number

Defines the TreeGrid width.

Contents
Contents