@syncfusion/ej2-treegrid 19.3.57 → 19.4.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/PULL_REQUEST_TEMPLATE/Bug.md +60 -0
- package/.github/PULL_REQUEST_TEMPLATE/feature.md +37 -0
- package/CHANGELOG.md +12 -33
- package/README.md +1 -1
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +194 -31
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +200 -30
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/treegrid/actions/batch-edit.js +5 -5
- package/src/treegrid/actions/edit.js +1 -2
- package/src/treegrid/actions/excel-export.js +5 -2
- package/src/treegrid/actions/virtual-scroll.js +4 -1
- package/src/treegrid/base/interface.d.ts +4 -0
- package/src/treegrid/base/treegrid-model.d.ts +16 -1
- package/src/treegrid/base/treegrid.d.ts +43 -2
- package/src/treegrid/base/treegrid.js +157 -20
- package/src/treegrid/models/column.d.ts +10 -1
- package/src/treegrid/models/column.js +19 -0
- package/src/treegrid/renderer/virtual-row-model-generator.js +8 -0
- package/src/treegrid/renderer/virtual-tree-content-render.js +3 -1
- package/styles/bootstrap-dark.css +5 -0
- package/styles/bootstrap.css +5 -0
- package/styles/bootstrap4.css +5 -0
- package/styles/bootstrap5-dark.css +32 -27
- package/styles/bootstrap5.css +32 -27
- package/styles/fabric-dark.css +5 -0
- package/styles/fabric.css +5 -0
- package/styles/highcontrast-light.css +5 -0
- package/styles/highcontrast.css +5 -0
- package/styles/material-dark.css +5 -0
- package/styles/material.css +5 -0
- package/styles/tailwind-dark.css +31 -26
- package/styles/tailwind.css +5 -0
- package/styles/treegrid/_bootstrap5-definition.scss +4 -4
- package/styles/treegrid/_fluent-definition.scss +31 -0
- package/styles/treegrid/_layout.scss +8 -0
- package/styles/treegrid/_tailwind-definition.scss +4 -4
- package/styles/treegrid/bootstrap-dark.css +5 -0
- package/styles/treegrid/bootstrap.css +5 -0
- package/styles/treegrid/bootstrap4.css +5 -0
- package/styles/treegrid/bootstrap5-dark.css +32 -27
- package/styles/treegrid/bootstrap5.css +32 -27
- package/styles/treegrid/fabric-dark.css +5 -0
- package/styles/treegrid/fabric.css +5 -0
- package/styles/treegrid/highcontrast-light.css +5 -0
- package/styles/treegrid/highcontrast.css +5 -0
- package/styles/treegrid/icons/_fluent.scss +26 -0
- package/styles/treegrid/material-dark.css +5 -0
- package/styles/treegrid/material.css +5 -0
- package/styles/treegrid/tailwind-dark.css +31 -26
- package/styles/treegrid/tailwind.css +5 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.
|
|
3
|
+
* version : 19.4.42
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-treegrid@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-treegrid@19.
|
|
3
|
+
"_id": "@syncfusion/ej2-treegrid@19.4.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-Q0BEZTlMhWTpuQFJfqWrPg2AFGZSr0o/r27/wnml/9aKsn/Gcp9hWrIKWn5/3+ADWfQiYkTQ+negKVenoXoqcA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-treegrid",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"/@syncfusion/ej2-react-treegrid",
|
|
25
25
|
"/@syncfusion/ej2-vue-treegrid"
|
|
26
26
|
],
|
|
27
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.
|
|
28
|
-
"_shasum": "
|
|
27
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.4.41.tgz",
|
|
28
|
+
"_shasum": "752b57c8545cdf6e5dba29d7270bef1d8a2d216c",
|
|
29
29
|
"_spec": "@syncfusion/ej2-treegrid@*",
|
|
30
30
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
31
31
|
"author": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"bundleDependencies": false,
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@syncfusion/ej2-base": "~19.
|
|
40
|
-
"@syncfusion/ej2-data": "~19.
|
|
41
|
-
"@syncfusion/ej2-grids": "~19.
|
|
42
|
-
"@syncfusion/ej2-popups": "~19.
|
|
39
|
+
"@syncfusion/ej2-base": "~19.4.42",
|
|
40
|
+
"@syncfusion/ej2-data": "~19.4.42",
|
|
41
|
+
"@syncfusion/ej2-grids": "~19.4.42",
|
|
42
|
+
"@syncfusion/ej2-popups": "~19.4.41"
|
|
43
43
|
},
|
|
44
44
|
"deprecated": false,
|
|
45
45
|
"description": "Essential JS 2 TreeGrid Component",
|
|
@@ -60,6 +60,6 @@
|
|
|
60
60
|
"url": "git+https://github.com/syncfusion/ej2-treegrid.git"
|
|
61
61
|
},
|
|
62
62
|
"typings": "index.d.ts",
|
|
63
|
-
"version": "19.
|
|
63
|
+
"version": "19.4.42",
|
|
64
64
|
"sideEffects": false
|
|
65
65
|
}
|
|
@@ -404,11 +404,6 @@ var BatchEdit = /** @class */ (function () {
|
|
|
404
404
|
var data = (this.parent.grid.dataSource instanceof DataManager ?
|
|
405
405
|
this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
|
|
406
406
|
var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
|
|
407
|
-
if (!isNullOrUndefined(this.parent[targetElement])) {
|
|
408
|
-
var row = this.parent[targetElement].closest('tr');
|
|
409
|
-
this.parent.collapseRow(row);
|
|
410
|
-
this.parent[targetElement] = null;
|
|
411
|
-
}
|
|
412
407
|
if (!isNullOrUndefined(this.batchAddedRecords)) {
|
|
413
408
|
for (var i = 0; i < this.batchAddedRecords.length; i++) {
|
|
414
409
|
index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
|
|
@@ -428,6 +423,11 @@ var BatchEdit = /** @class */ (function () {
|
|
|
428
423
|
}
|
|
429
424
|
}
|
|
430
425
|
}
|
|
426
|
+
if (!isNullOrUndefined(this.parent[targetElement])) {
|
|
427
|
+
var row = this.parent[targetElement].closest('tr');
|
|
428
|
+
this.parent.collapseRow(row);
|
|
429
|
+
this.parent[targetElement] = null;
|
|
430
|
+
}
|
|
431
431
|
if (!isNullOrUndefined(this.batchDeletedRecords)) {
|
|
432
432
|
for (var i = 0; i < this.batchDeletedRecords.length; i++) {
|
|
433
433
|
if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
|
|
@@ -809,8 +809,7 @@ var Edit = /** @class */ (function () {
|
|
|
809
809
|
var currentData = this.parent.grid.getCurrentViewRecords();
|
|
810
810
|
if (this.parent.enableVirtualization && args.index !== 0) {
|
|
811
811
|
this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
|
|
812
|
-
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'));
|
|
813
|
-
;
|
|
812
|
+
this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
|
|
814
813
|
}
|
|
815
814
|
var index = this.addRowIndex;
|
|
816
815
|
value.uniqueID = getUid(this.parent.element.id + '_data_');
|
|
@@ -170,9 +170,9 @@ var ExcelExport = /** @class */ (function () {
|
|
|
170
170
|
if (excelRow.type === 'excel') {
|
|
171
171
|
var excelrowobj = excelRow.rowObj.data;
|
|
172
172
|
var filtercolumnlength = this.parent.grid.filterSettings.columns.length;
|
|
173
|
+
var rowlength = excelRow.excelRows.length;
|
|
174
|
+
var rowlevel = excelrowobj.level;
|
|
173
175
|
if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {
|
|
174
|
-
var rowlength = excelRow.excelRows.length;
|
|
175
|
-
var rowlevel = excelrowobj.level;
|
|
176
176
|
var expandedStatus = false;
|
|
177
177
|
var sublevelState = false;
|
|
178
178
|
var state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);
|
|
@@ -183,6 +183,9 @@ var ExcelExport = /** @class */ (function () {
|
|
|
183
183
|
excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,
|
|
184
184
|
isHidden: expandedStatus };
|
|
185
185
|
}
|
|
186
|
+
else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {
|
|
187
|
+
excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };
|
|
188
|
+
}
|
|
186
189
|
}
|
|
187
190
|
};
|
|
188
191
|
/* eslint-disable-next-line */
|
|
@@ -84,7 +84,10 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
84
84
|
record: row.record,
|
|
85
85
|
count: this.parent.flatData.length
|
|
86
86
|
};
|
|
87
|
-
this.parent.
|
|
87
|
+
if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||
|
|
88
|
+
this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
|
|
89
|
+
this.parent.grid.clearSelection();
|
|
90
|
+
}
|
|
88
91
|
var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
|
|
89
92
|
getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
|
|
90
93
|
};
|
|
@@ -128,6 +128,8 @@ export interface RowExpandingEventArgs {
|
|
|
128
128
|
row?: HTMLTableRowElement;
|
|
129
129
|
/** Cancel the row expanding action */
|
|
130
130
|
cancel?: boolean;
|
|
131
|
+
/** Provides an option to ExpandAll the nested parent rows of the current row. */
|
|
132
|
+
expandAll?: boolean;
|
|
131
133
|
}
|
|
132
134
|
export interface RowCollapsedEventArgs {
|
|
133
135
|
/**
|
|
@@ -150,6 +152,8 @@ export interface RowCollapsingEventArgs {
|
|
|
150
152
|
row?: HTMLTableRowElement;
|
|
151
153
|
/** Cancel the row collapsing action */
|
|
152
154
|
cancel?: boolean;
|
|
155
|
+
/** Provides an option to CollapseAll the nested parent rows of the current row. */
|
|
156
|
+
collapseAll?: boolean;
|
|
153
157
|
}
|
|
154
158
|
export interface CellSaveEventArgs extends SaveEventArgs {
|
|
155
159
|
/** Defines edited column */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel } from '@syncfusion/ej2-grids';import {RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid } from '@syncfusion/ej2-grids';import { ActionEventArgs } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { CellSaveEventArgs, DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';
|
|
1
|
+
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, Ajax, ModuleDeclaration, extend} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue } from '@syncfusion/ej2-base';import {Event, Property, NotifyPropertyChanges, INotifyPropertyChanged, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';import { Column, ColumnModel } from '../models/column';import { BeforeBatchSaveArgs, BeforeBatchAddArgs, BatchDeleteArgs, BeforeBatchDeleteArgs, Row, CellRenderer, Cell } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel } from '@syncfusion/ej2-grids';import {RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid } from '@syncfusion/ej2-grids';import { ActionEventArgs } from'@syncfusion/ej2-grids';import { DetailDataBoundEventArgs, ClipMode, ColumnChooser} from '@syncfusion/ej2-grids';import { SearchEventArgs, AddEventArgs, EditEventArgs, DeleteEventArgs} from '@syncfusion/ej2-grids';import { SaveEventArgs, CellSaveArgs, BatchAddArgs, BatchCancelArgs, BeginEditArgs, CellEditArgs} from '@syncfusion/ej2-grids';import { FilterSettings } from '../models/filter-settings';import { TextWrapSettings } from '../models/textwrap-settings';import { TextWrapSettingsModel } from '../models/textwrap-settings-model';import {Filter} from '../actions/filter';import { Logger as TreeLogger } from '../actions/logger';import { BeforeCopyEventArgs, BeforePasteEventArgs } from '@syncfusion/ej2-grids';import { TreeClipboard } from '../actions/clipboard';import {Aggregate} from '../actions/summary';import { Reorder } from '../actions/reorder';import { Resize } from '../actions/resize';import { Selection as TreeGridSelection } from '../actions/selection';import { ColumnMenu } from '../actions/column-menu';import { DetailRow } from '../actions/detail-row';import { Freeze } from '../actions/freeze-column';import { Print } from '../actions/print';import * as events from '../base/constant';import { FilterSettingsModel } from '../models/filter-settings-model';import { SearchSettings} from '../models/search-settings';import { SearchSettingsModel } from '../models/search-settings-model';import {RowInfo, RowDataBoundEventArgs, PageEventArgs, FilterEventArgs, FailureEventArgs, SortEventArgs } from '@syncfusion/ej2-grids';import { RowSelectingEventArgs, RowSelectEventArgs, RowDeselectEventArgs, IIndex, ISelectedCell } from '@syncfusion/ej2-grids';import {ColumnModel as GridColumnModel, Column as GridColumn, CellSelectEventArgs, CellDeselectEventArgs } from '@syncfusion/ej2-grids';import { SelectionSettings } from '../models/selection-settings';import { SelectionSettingsModel } from '../models/selection-settings-model';import {getActualProperties, SortDirection, getObject, ColumnDragEventArgs } from '@syncfusion/ej2-grids';import { PrintMode, Data, IGrid, ContextMenuItemModel } from '@syncfusion/ej2-grids';import { ColumnMenuItem, ColumnMenuItemModel, CheckBoxChangeEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportCompleteArgs, ExcelHeaderQueryCellInfoEventArgs, ExcelQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { PdfExportCompleteArgs, PdfHeaderQueryCellInfoEventArgs, PdfQueryCellInfoEventArgs } from '@syncfusion/ej2-grids';import { ExcelExportProperties, PdfExportProperties, CellSelectingEventArgs, PrintEventArgs } from '@syncfusion/ej2-grids';import { ColumnMenuOpenEventArgs } from '@syncfusion/ej2-grids';import {BeforeDataBoundArgs} from '@syncfusion/ej2-grids';import { DataManager, ReturnOption, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';import { createSpinner, hideSpinner, showSpinner, Dialog } from '@syncfusion/ej2-popups';import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';import { Grid, QueryCellInfoEventArgs, Logger } from '@syncfusion/ej2-grids';import { Render } from '../renderer/render';import { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';import { DataManipulation } from './data';import { RowDD } from '../actions/rowdragdrop';import { Sort } from '../actions/sort';import { ITreeData, RowExpandedEventArgs, RowCollapsedEventArgs, RowCollapsingEventArgs, TreeGridExcelExportProperties } from './interface';import { CellSaveEventArgs, DataStateChangeEventArgs, RowExpandingEventArgs, TreeGridPdfExportProperties } from './interface';import { iterateArrayOrObject, GridLine } from '@syncfusion/ej2-grids';import { DataSourceChangedEventArgs, RecordDoubleClickEventArgs, ResizeArgs } from '@syncfusion/ej2-grids';import { ToolbarItems, ToolbarItem, ContextMenuItem, ContextMenuItems, RowPosition, CopyHierarchyType } from '../enum';import { ItemModel, ClickEventArgs, BeforeOpenCloseMenuEventArgs, MenuEventArgs } from '@syncfusion/ej2-navigations';import { PageSettings } from '../models/page-settings';import { PageSettingsModel } from '../models/page-settings-model';import { AggregateRow } from '../models/summary';import { AggregateRowModel } from '../models/summary-model';import { ExcelExport } from '../actions/excel-export';import { PdfExport } from '../actions/pdf-export';import { Toolbar } from '../actions/toolbar';import { Page } from '../actions/page';import { ContextMenu } from '../actions/context-menu';import { EditSettings } from '../models/edit-settings';import { EditSettingsModel } from '../models/edit-settings-model';import { Edit} from '../actions/edit';import { SortSettings } from '../models/sort-settings';import { SortSettingsModel } from '../models/sort-settings-model';import { isHidden, getExpandStatus } from '../utils';import { editAction } from '../actions/crud-actions';import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';import { InfiniteScrollSettingsModel } from '../models/infinite-scroll-settings-model';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -432,6 +432,21 @@ export interface TreeGridModel extends ComponentModel{
|
|
|
432
432
|
*/
|
|
433
433
|
enableAutoFill?: boolean;
|
|
434
434
|
|
|
435
|
+
/**
|
|
436
|
+
* If `enableAdaptiveUI` is set to true, the pop-up UI will become adaptive to small screens,
|
|
437
|
+
* and be used for filtering and other features.
|
|
438
|
+
* ```html
|
|
439
|
+
* <div id='treegrid'></div>
|
|
440
|
+
* <script>
|
|
441
|
+
* var treegridObj = new TreeGrid({ enableAdaptiveUI: true });
|
|
442
|
+
* treegridObj.appendTo('#treegrid');
|
|
443
|
+
* </script>
|
|
444
|
+
* ```
|
|
445
|
+
*
|
|
446
|
+
* @default false
|
|
447
|
+
*/
|
|
448
|
+
enableAdaptiveUI?: boolean;
|
|
449
|
+
|
|
435
450
|
/**
|
|
436
451
|
* If `enableImmutableMode` is set to true, the TreeGrid will reuse old rows if it exists in the new result instead of
|
|
437
452
|
* full refresh while performing the TreeGrid actions.
|
|
@@ -540,6 +540,20 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
540
540
|
* @default false
|
|
541
541
|
*/
|
|
542
542
|
enableAutoFill: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* If `enableAdaptiveUI` is set to true, the pop-up UI will become adaptive to small screens,
|
|
545
|
+
* and be used for filtering and other features.
|
|
546
|
+
* ```html
|
|
547
|
+
* <div id='treegrid'></div>
|
|
548
|
+
* <script>
|
|
549
|
+
* var treegridObj = new TreeGrid({ enableAdaptiveUI: true });
|
|
550
|
+
* treegridObj.appendTo('#treegrid');
|
|
551
|
+
* </script>
|
|
552
|
+
* ```
|
|
553
|
+
*
|
|
554
|
+
* @default false
|
|
555
|
+
*/
|
|
556
|
+
enableAdaptiveUI: boolean;
|
|
543
557
|
/**
|
|
544
558
|
* If `enableImmutableMode` is set to true, the TreeGrid will reuse old rows if it exists in the new result instead of
|
|
545
559
|
* full refresh while performing the TreeGrid actions.
|
|
@@ -1514,6 +1528,12 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1514
1528
|
*/
|
|
1515
1529
|
getColumns(isRefresh?: boolean): Column[];
|
|
1516
1530
|
private updateColumnModel;
|
|
1531
|
+
/**
|
|
1532
|
+
* @param {string} columnUid - Defines column uid
|
|
1533
|
+
* @returns {void}
|
|
1534
|
+
* @hidden
|
|
1535
|
+
*/
|
|
1536
|
+
private refreshReactColumnTemplateByUid;
|
|
1517
1537
|
/**
|
|
1518
1538
|
* Gets the content div of the TreeGrid.
|
|
1519
1539
|
*
|
|
@@ -1658,9 +1678,12 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1658
1678
|
*
|
|
1659
1679
|
* @param {HTMLTableRowElement} row - Expands the given row
|
|
1660
1680
|
* @param {Object} record - Expands the given record
|
|
1681
|
+
* @param {Object} key - Primary key value
|
|
1682
|
+
* @param {number} level - Specifies the hierarchical level of the record
|
|
1661
1683
|
* @returns {void}
|
|
1662
1684
|
*/
|
|
1663
|
-
expandRow(row: HTMLTableRowElement, record?: Object): void;
|
|
1685
|
+
expandRow(row: HTMLTableRowElement, record?: Object, key?: Object, level?: number): void;
|
|
1686
|
+
private expandCollapseAllChildren;
|
|
1664
1687
|
private setHeightForFrozenContent;
|
|
1665
1688
|
private getCollapseExpandRecords;
|
|
1666
1689
|
/**
|
|
@@ -1668,9 +1691,10 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1668
1691
|
*
|
|
1669
1692
|
* @param {HTMLTableRowElement} row - Collapse the given row
|
|
1670
1693
|
* @param {Object} record - Collapse the given record
|
|
1694
|
+
* @param {Object} key - Primary key value
|
|
1671
1695
|
* @returns {void}
|
|
1672
1696
|
*/
|
|
1673
|
-
collapseRow(row: HTMLTableRowElement, record?: Object): void;
|
|
1697
|
+
collapseRow(row: HTMLTableRowElement, record?: Object, key?: Object): void;
|
|
1674
1698
|
/**
|
|
1675
1699
|
* Expands the records at specific hierarchical level
|
|
1676
1700
|
*
|
|
@@ -1678,6 +1702,14 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1678
1702
|
* @returns {void}
|
|
1679
1703
|
*/
|
|
1680
1704
|
expandAtLevel(level: number): void;
|
|
1705
|
+
/**
|
|
1706
|
+
* Expands the records by given primary key value
|
|
1707
|
+
*
|
|
1708
|
+
* @param {Object} key - Expands the parent rows with given primary key value
|
|
1709
|
+
* @returns {void}
|
|
1710
|
+
*/
|
|
1711
|
+
expandByKey(key: Object): void;
|
|
1712
|
+
private expandAction;
|
|
1681
1713
|
private getRecordDetails;
|
|
1682
1714
|
/**
|
|
1683
1715
|
* Collapses the records at specific hierarchical level
|
|
@@ -1686,6 +1718,15 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1686
1718
|
* @returns {void}
|
|
1687
1719
|
*/
|
|
1688
1720
|
collapseAtLevel(level: number): void;
|
|
1721
|
+
/**
|
|
1722
|
+
* Collapses the records by given primary key value
|
|
1723
|
+
*
|
|
1724
|
+
* @param {Object} key - Collapses the parent rows with given primary key value
|
|
1725
|
+
* @returns {void}
|
|
1726
|
+
*/
|
|
1727
|
+
collapseByKey(key: Object): void;
|
|
1728
|
+
private expandCollapseActionByKey;
|
|
1729
|
+
private collapseAction;
|
|
1689
1730
|
/**
|
|
1690
1731
|
* Expands All the rows
|
|
1691
1732
|
*
|
|
@@ -21,6 +21,7 @@ import { Component, addClass, createElement, EventHandler, isNullOrUndefined, ex
|
|
|
21
21
|
import { removeClass, Complex, Collection, getValue } from '@syncfusion/ej2-base';
|
|
22
22
|
import { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';
|
|
23
23
|
import { Column } from '../models/column';
|
|
24
|
+
import { CellRenderer } from '@syncfusion/ej2-grids';
|
|
24
25
|
import { RowDropSettings, getUid } from '@syncfusion/ej2-grids';
|
|
25
26
|
import { FilterSettings } from '../models/filter-settings';
|
|
26
27
|
import { TextWrapSettings } from '../models/textwrap-settings';
|
|
@@ -32,7 +33,7 @@ import * as events from '../base/constant';
|
|
|
32
33
|
import { SearchSettings } from '../models/search-settings';
|
|
33
34
|
import { SelectionSettings } from '../models/selection-settings';
|
|
34
35
|
import { getActualProperties, getObject } from '@syncfusion/ej2-grids';
|
|
35
|
-
import { DataManager, RemoteSaveAdaptor, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';
|
|
36
|
+
import { DataManager, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';
|
|
36
37
|
import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
37
38
|
import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';
|
|
38
39
|
import { Grid, Logger } from '@syncfusion/ej2-grids';
|
|
@@ -44,7 +45,7 @@ import { PageSettings } from '../models/page-settings';
|
|
|
44
45
|
import { AggregateRow } from '../models/summary';
|
|
45
46
|
import { EditSettings } from '../models/edit-settings';
|
|
46
47
|
import { SortSettings } from '../models/sort-settings';
|
|
47
|
-
import { isHidden } from '../utils';
|
|
48
|
+
import { isHidden, getExpandStatus } from '../utils';
|
|
48
49
|
import { editAction } from '../actions/crud-actions';
|
|
49
50
|
import { InfiniteScrollSettings } from '../models/infinite-scroll-settings';
|
|
50
51
|
/**
|
|
@@ -674,6 +675,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
674
675
|
this.grid.allowResizing = this.allowResizing;
|
|
675
676
|
this.grid.enableHover = this.enableHover;
|
|
676
677
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
678
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
677
679
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
678
680
|
this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
|
|
679
681
|
this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);
|
|
@@ -723,7 +725,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
723
725
|
_this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {
|
|
724
726
|
var updateRowSelection = 'updateRowSelection';
|
|
725
727
|
for (var i = 0; i < _this.getRows().length; i++) {
|
|
726
|
-
if (_this.getRows()[i].getElementsByClassName(
|
|
728
|
+
if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
|
|
727
729
|
_this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);
|
|
728
730
|
}
|
|
729
731
|
}
|
|
@@ -838,6 +840,16 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
838
840
|
}
|
|
839
841
|
}
|
|
840
842
|
}
|
|
843
|
+
var action = 'action';
|
|
844
|
+
if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {
|
|
845
|
+
var refreshPersistSelection = 'refreshPersistSelection';
|
|
846
|
+
_this.grid.selectionModule[refreshPersistSelection]();
|
|
847
|
+
if (_this.grid.selectionSettings.type === 'Single') {
|
|
848
|
+
var updateRowSelection = 'updateRowSelection';
|
|
849
|
+
var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);
|
|
850
|
+
_this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
841
853
|
_this.trigger(events.dataBound, args);
|
|
842
854
|
_this.initialRender = false;
|
|
843
855
|
};
|
|
@@ -1035,8 +1047,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1035
1047
|
_this.notify('clearFilters', { flatData: _this.grid.dataSource });
|
|
1036
1048
|
_this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
|
|
1037
1049
|
if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
|
|
1038
|
-
_this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ?
|
|
1050
|
+
_this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ?
|
|
1051
|
+
_this.grid.dataSource :
|
|
1039
1052
|
(isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));
|
|
1053
|
+
_this.grid.renderModule.data.isQueryInvokedFromData = true;
|
|
1054
|
+
_this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();
|
|
1040
1055
|
}
|
|
1041
1056
|
}
|
|
1042
1057
|
var callBackPromise = new Deferred();
|
|
@@ -1486,6 +1501,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1486
1501
|
case 'enableAutoFill':
|
|
1487
1502
|
this.grid.enableAutoFill = this.enableAutoFill;
|
|
1488
1503
|
break;
|
|
1504
|
+
case 'enableAdaptiveUI':
|
|
1505
|
+
this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
|
|
1506
|
+
break;
|
|
1489
1507
|
case 'enableImmutableMode':
|
|
1490
1508
|
this.grid.enableImmutableMode = this.enableImmutableMode;
|
|
1491
1509
|
break;
|
|
@@ -2066,7 +2084,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2066
2084
|
gridColumn[prop] = gridColumns[i][prop];
|
|
2067
2085
|
}
|
|
2068
2086
|
this.columnModel.push(new Column(gridColumn));
|
|
2069
|
-
if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
2087
|
+
if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
|
|
2070
2088
|
this.columnModel[i].template = temp;
|
|
2071
2089
|
}
|
|
2072
2090
|
}
|
|
@@ -2082,6 +2100,32 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2082
2100
|
this[merge] = undefined; // Workaround for blazor updateModel
|
|
2083
2101
|
return this.columnModel;
|
|
2084
2102
|
};
|
|
2103
|
+
/**
|
|
2104
|
+
* @param {string} columnUid - Defines column uid
|
|
2105
|
+
* @returns {void}
|
|
2106
|
+
* @hidden
|
|
2107
|
+
*/
|
|
2108
|
+
TreeGrid.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
|
|
2109
|
+
var _this = this;
|
|
2110
|
+
if (this.isReact) {
|
|
2111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2112
|
+
this.clearTemplate(['columnTemplate'], undefined, function () {
|
|
2113
|
+
var cells = 'cells';
|
|
2114
|
+
var rowIdx = 'index';
|
|
2115
|
+
var rowsObj = _this.grid.getRowsObject();
|
|
2116
|
+
var indent = _this.grid.getIndentCount();
|
|
2117
|
+
var cellIndex = _this.grid.getNormalizedColumnIndex(columnUid);
|
|
2118
|
+
for (var j = 0; j < rowsObj.length; j++) {
|
|
2119
|
+
if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
|
|
2120
|
+
var cell = rowsObj[j][cells][cellIndex];
|
|
2121
|
+
var cellRenderer = new CellRenderer(_this.grid, _this.grid.serviceLocator);
|
|
2122
|
+
var td = _this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
|
|
2123
|
+
cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
});
|
|
2127
|
+
}
|
|
2128
|
+
};
|
|
2085
2129
|
/**
|
|
2086
2130
|
* Gets the content div of the TreeGrid.
|
|
2087
2131
|
*
|
|
@@ -2351,9 +2395,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2351
2395
|
*
|
|
2352
2396
|
* @param {HTMLTableRowElement} row - Expands the given row
|
|
2353
2397
|
* @param {Object} record - Expands the given record
|
|
2398
|
+
* @param {Object} key - Primary key value
|
|
2399
|
+
* @param {number} level - Specifies the hierarchical level of the record
|
|
2354
2400
|
* @returns {void}
|
|
2355
2401
|
*/
|
|
2356
|
-
TreeGrid.prototype.expandRow = function (row, record) {
|
|
2402
|
+
TreeGrid.prototype.expandRow = function (row, record, key, level) {
|
|
2357
2403
|
var _this = this;
|
|
2358
2404
|
record = this.getCollapseExpandRecords(row, record);
|
|
2359
2405
|
if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
|
|
@@ -2363,6 +2409,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2363
2409
|
this.trigger(events.expanding, args, function (expandingArgs) {
|
|
2364
2410
|
if (!expandingArgs.cancel) {
|
|
2365
2411
|
_this.expandCollapse('expand', row, record);
|
|
2412
|
+
if (expandingArgs.expandAll) {
|
|
2413
|
+
_this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
2414
|
+
}
|
|
2366
2415
|
var children = 'Children';
|
|
2367
2416
|
if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
|
|
2368
2417
|
var collapseArgs = { data: record, row: row };
|
|
@@ -2372,6 +2421,19 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2372
2421
|
}
|
|
2373
2422
|
});
|
|
2374
2423
|
};
|
|
2424
|
+
TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {
|
|
2425
|
+
if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
|
|
2426
|
+
(!isNullOrUndefined(level) && level !== record.level)) {
|
|
2427
|
+
return;
|
|
2428
|
+
}
|
|
2429
|
+
var records = findChildrenRecords(record).filter(function (e) {
|
|
2430
|
+
return e.hasChildRecords;
|
|
2431
|
+
});
|
|
2432
|
+
records.unshift(record);
|
|
2433
|
+
for (var i = 0; i < records.length; i++) {
|
|
2434
|
+
this.expandCollapse(action, null, records[i]);
|
|
2435
|
+
}
|
|
2436
|
+
};
|
|
2375
2437
|
TreeGrid.prototype.setHeightForFrozenContent = function () {
|
|
2376
2438
|
var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
|
|
2377
2439
|
if (this.grid.getFrozenColumns() > 0 || freeze) {
|
|
@@ -2395,14 +2457,18 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2395
2457
|
*
|
|
2396
2458
|
* @param {HTMLTableRowElement} row - Collapse the given row
|
|
2397
2459
|
* @param {Object} record - Collapse the given record
|
|
2460
|
+
* @param {Object} key - Primary key value
|
|
2398
2461
|
* @returns {void}
|
|
2399
2462
|
*/
|
|
2400
|
-
TreeGrid.prototype.collapseRow = function (row, record) {
|
|
2463
|
+
TreeGrid.prototype.collapseRow = function (row, record, key) {
|
|
2401
2464
|
var _this = this;
|
|
2402
2465
|
record = this.getCollapseExpandRecords(row, record);
|
|
2403
2466
|
var args = { data: record, row: row, cancel: false };
|
|
2404
2467
|
this.trigger(events.collapsing, args, function (collapsingArgs) {
|
|
2405
2468
|
if (!collapsingArgs.cancel) {
|
|
2469
|
+
if (collapsingArgs.collapseAll) {
|
|
2470
|
+
_this.expandCollapseAllChildren(record, 'collapse', key);
|
|
2471
|
+
}
|
|
2406
2472
|
_this.expandCollapse('collapse', row, record);
|
|
2407
2473
|
var collapseArgs = { data: record, row: row };
|
|
2408
2474
|
if (!isRemoteData(_this)) {
|
|
@@ -2433,22 +2499,58 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2433
2499
|
}
|
|
2434
2500
|
return e.hasChildRecords && e.level === level;
|
|
2435
2501
|
});
|
|
2436
|
-
this.
|
|
2502
|
+
this.expandAction(rec, null, level, true);
|
|
2437
2503
|
}
|
|
2438
2504
|
else {
|
|
2439
2505
|
var rec = this.getRecordDetails(level);
|
|
2440
|
-
var row = getObject('rows', rec);
|
|
2441
2506
|
var record = getObject('records', rec);
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2507
|
+
this.expandAction(record, null, level);
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
/**
|
|
2511
|
+
* Expands the records by given primary key value
|
|
2512
|
+
*
|
|
2513
|
+
* @param {Object} key - Expands the parent rows with given primary key value
|
|
2514
|
+
* @returns {void}
|
|
2515
|
+
*/
|
|
2516
|
+
TreeGrid.prototype.expandByKey = function (key) {
|
|
2517
|
+
this.expandCollapseActionByKey(key, 'Expand');
|
|
2518
|
+
};
|
|
2519
|
+
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
2520
|
+
if (isPaging === void 0) { isPaging = false; }
|
|
2521
|
+
var _loop_1 = function (i) {
|
|
2522
|
+
if (!isNullOrUndefined(record[i].parentItem)) {
|
|
2523
|
+
var puniqueID_1 = record[i].parentItem.uniqueID;
|
|
2524
|
+
var parentItem = this_1.flatData.filter(function (e) {
|
|
2525
|
+
return e.uniqueID === puniqueID_1;
|
|
2526
|
+
});
|
|
2527
|
+
if (isRemoteData(this_1)) {
|
|
2528
|
+
parentItem = this_1.getCurrentViewRecords().filter(function (e) {
|
|
2529
|
+
return e.uniqueID === puniqueID_1;
|
|
2530
|
+
});
|
|
2531
|
+
}
|
|
2532
|
+
if (parentItem[0].expanded === false) {
|
|
2533
|
+
record.push(parentItem[0]);
|
|
2534
|
+
parentItem[0].expanded = true;
|
|
2535
|
+
}
|
|
2536
|
+
else {
|
|
2537
|
+
if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {
|
|
2538
|
+
if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
|
|
2539
|
+
record.push(parentItem[0]);
|
|
2540
|
+
}
|
|
2448
2541
|
}
|
|
2449
2542
|
}
|
|
2450
|
-
this.expandRow(row[i], record[i]);
|
|
2451
2543
|
}
|
|
2544
|
+
if (!isPaging) {
|
|
2545
|
+
this_1.expandRow(null, record[i], key, level);
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
var this_1 = this;
|
|
2549
|
+
for (var i = 0; i < record.length; i++) {
|
|
2550
|
+
_loop_1(i);
|
|
2551
|
+
}
|
|
2552
|
+
if (isPaging) {
|
|
2553
|
+
this.expandRow(null, record, key, level);
|
|
2452
2554
|
}
|
|
2453
2555
|
};
|
|
2454
2556
|
TreeGrid.prototype.getRecordDetails = function (level) {
|
|
@@ -2476,14 +2578,46 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2476
2578
|
}
|
|
2477
2579
|
return e.hasChildRecords && e.level === level;
|
|
2478
2580
|
});
|
|
2479
|
-
this.
|
|
2581
|
+
this.collapseAction(record, null, true);
|
|
2480
2582
|
}
|
|
2481
2583
|
else {
|
|
2482
2584
|
var rec = this.getRecordDetails(level);
|
|
2483
|
-
var rows = getObject('rows', rec);
|
|
2484
2585
|
var records = getObject('records', rec);
|
|
2485
|
-
|
|
2486
|
-
|
|
2586
|
+
this.collapseAction(records);
|
|
2587
|
+
}
|
|
2588
|
+
};
|
|
2589
|
+
/**
|
|
2590
|
+
* Collapses the records by given primary key value
|
|
2591
|
+
*
|
|
2592
|
+
* @param {Object} key - Collapses the parent rows with given primary key value
|
|
2593
|
+
* @returns {void}
|
|
2594
|
+
*/
|
|
2595
|
+
TreeGrid.prototype.collapseByKey = function (key) {
|
|
2596
|
+
this.expandCollapseActionByKey(key, 'Collapse');
|
|
2597
|
+
};
|
|
2598
|
+
TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
|
|
2599
|
+
var primaryKeyField = this.getPrimaryKeyFieldNames()[0];
|
|
2600
|
+
var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
|
|
2601
|
+
if (!isNullOrUndefined(primaryKeyField)) {
|
|
2602
|
+
var rec = dataSource.filter(function (e) {
|
|
2603
|
+
return e[primaryKeyField].toString() === key.toString();
|
|
2604
|
+
});
|
|
2605
|
+
if (action === 'Expand') {
|
|
2606
|
+
this.expandAction(rec, key, null);
|
|
2607
|
+
}
|
|
2608
|
+
else {
|
|
2609
|
+
this.collapseAction(rec, key);
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
};
|
|
2613
|
+
TreeGrid.prototype.collapseAction = function (record, key, isPaging) {
|
|
2614
|
+
if (isPaging === void 0) { isPaging = false; }
|
|
2615
|
+
if (isPaging) {
|
|
2616
|
+
this.collapseRow(null, record);
|
|
2617
|
+
}
|
|
2618
|
+
else {
|
|
2619
|
+
for (var i = 0; i < record.length; i++) {
|
|
2620
|
+
this.collapseRow(null, record[i], key);
|
|
2487
2621
|
}
|
|
2488
2622
|
}
|
|
2489
2623
|
if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
|
|
@@ -3393,6 +3527,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3393
3527
|
__decorate([
|
|
3394
3528
|
Property(false)
|
|
3395
3529
|
], TreeGrid.prototype, "enableAutoFill", void 0);
|
|
3530
|
+
__decorate([
|
|
3531
|
+
Property(false)
|
|
3532
|
+
], TreeGrid.prototype, "enableAdaptiveUI", void 0);
|
|
3396
3533
|
__decorate([
|
|
3397
3534
|
Property(false)
|
|
3398
3535
|
], TreeGrid.prototype, "enableImmutableMode", void 0);
|
|
@@ -326,7 +326,16 @@ export declare class Column {
|
|
|
326
326
|
* @default null
|
|
327
327
|
*/
|
|
328
328
|
freeze: freezeDirection;
|
|
329
|
+
private parent;
|
|
329
330
|
constructor(options: ColumnModel);
|
|
331
|
+
/**
|
|
332
|
+
* Update the State changes reflected for TreeGrid columndirective in react platform.
|
|
333
|
+
*
|
|
334
|
+
* @param {Column} column - specifies the column
|
|
335
|
+
* @returns {void}
|
|
336
|
+
* @hidden
|
|
337
|
+
*/
|
|
338
|
+
private setProperties;
|
|
330
339
|
}
|
|
331
340
|
/**
|
|
332
341
|
* Interface for a TreeGrid class Column
|
|
@@ -694,7 +703,7 @@ export interface ColumnModel {
|
|
|
694
703
|
*
|
|
695
704
|
* @default Syncfusion.EJ2.Grids.FreezeDirection.None
|
|
696
705
|
* @isEnumeration true
|
|
697
|
-
* @aspType Syncfusion.EJ2.Grids.FreezeDirection
|
|
706
|
+
* @aspType Syncfusion.EJ2.Grids.FreezeDirection
|
|
698
707
|
*/
|
|
699
708
|
freeze?: freezeDirection;
|
|
700
709
|
}
|
|
@@ -71,6 +71,25 @@ var Column = /** @class */ (function () {
|
|
|
71
71
|
this.filter = {};
|
|
72
72
|
merge(this, options);
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Update the State changes reflected for TreeGrid columndirective in react platform.
|
|
76
|
+
*
|
|
77
|
+
* @param {Column} column - specifies the column
|
|
78
|
+
* @returns {void}
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
Column.prototype.setProperties = function (column) {
|
|
82
|
+
//Angular two way binding
|
|
83
|
+
var keys = Object.keys(column);
|
|
84
|
+
for (var i = 0; i < keys.length; i++) {
|
|
85
|
+
this[keys[i]] = column[keys[i]];
|
|
86
|
+
//Refresh the react columnTemplates on state change
|
|
87
|
+
if (this.parent && this.parent['isReact'] && keys[i] === 'template') {
|
|
88
|
+
var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
|
|
89
|
+
this.parent.clipboardModule['treeGridParent'][refreshReactColumnTemplateByUid](this.uid);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
74
93
|
return Column;
|
|
75
94
|
}());
|
|
76
95
|
export { Column };
|