@syncfusion/ej2-treegrid 32.2.7 → 33.1.44
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/dist/ej2-treegrid.min.js +2 -2
- 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 +230 -77
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +234 -78
- 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 +5 -5
- package/src/treegrid/actions/excel-export.js +35 -5
- package/src/treegrid/actions/pdf-export.js +1 -1
- package/src/treegrid/actions/rowdragdrop.js +8 -2
- package/src/treegrid/base/data.js +2 -33
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +34 -0
- package/src/treegrid/base/treegrid.js +124 -9
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +4 -5
- package/src/treegrid/renderer/virtual-tree-content-render.js +65 -29
- package/styles/fluent2.css +1 -0
- package/styles/material3-dark-lite.css +2 -2
- package/styles/material3-dark.css +2 -2
- package/styles/material3-lite.css +2 -2
- package/styles/material3.css +2 -2
- package/styles/treegrid/_bigger.scss +3 -0
- package/styles/treegrid/fluent2.css +1 -0
- package/styles/treegrid/icons/_material3.scss +2 -2
- package/styles/treegrid/material3-dark.css +2 -2
- package/styles/treegrid/material3.css +2 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 33.1.44
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-treegrid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "33.1.44",
|
|
4
4
|
"description": "Essential JS 2 TreeGrid Component",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"module": "./index.js",
|
|
9
9
|
"es2015": "./dist/es6/ej2-treegrid.es5.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@syncfusion/ej2-base": "~
|
|
12
|
-
"@syncfusion/ej2-data": "~
|
|
13
|
-
"@syncfusion/ej2-grids": "~
|
|
14
|
-
"@syncfusion/ej2-popups": "~
|
|
11
|
+
"@syncfusion/ej2-base": "~33.1.44",
|
|
12
|
+
"@syncfusion/ej2-data": "~33.1.44",
|
|
13
|
+
"@syncfusion/ej2-grids": "~33.1.44",
|
|
14
|
+
"@syncfusion/ej2-popups": "~33.1.44"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {},
|
|
17
17
|
"keywords": [
|
|
@@ -95,11 +95,22 @@ var ExcelExport = /** @class */ (function () {
|
|
|
95
95
|
var query = new Query();
|
|
96
96
|
if (!_this.isLocal()) {
|
|
97
97
|
query = _this.generateQuery(query);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
var hasFilter = _this.parent.grid.filterSettings &&
|
|
99
|
+
Array.isArray(_this.parent.grid.filterSettings.columns) &&
|
|
100
|
+
_this.parent.grid.filterSettings.columns.length > 0;
|
|
101
|
+
var hasSearch = _this.parent.grid.searchSettings &&
|
|
102
|
+
typeof _this.parent.grid.searchSettings.key === 'string' &&
|
|
103
|
+
_this.parent.grid.searchSettings.key.trim().length > 0;
|
|
104
|
+
var hasSorting = _this.parent.grid.sortSettings &&
|
|
105
|
+
Array.isArray(_this.parent.grid.sortSettings.columns) &&
|
|
106
|
+
_this.parent.grid.sortSettings.columns.length > 0;
|
|
107
|
+
if (hasFilter || hasSearch || hasSorting) {
|
|
108
|
+
query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
|
|
109
|
+
query = ExportHelper.getQuery(_this.parent.grid, data);
|
|
110
|
+
if (isNullOrUndefined(_this.parent.filterModule)) {
|
|
111
|
+
query.queries = query.queries.slice(1, 2);
|
|
112
|
+
query.params = query.params.slice(0, 0);
|
|
113
|
+
}
|
|
103
114
|
}
|
|
104
115
|
setValue('query', query, property);
|
|
105
116
|
}
|
|
@@ -136,11 +147,30 @@ var ExcelExport = /** @class */ (function () {
|
|
|
136
147
|
return query;
|
|
137
148
|
};
|
|
138
149
|
ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {
|
|
150
|
+
var _this = this;
|
|
139
151
|
//count not required for this query
|
|
140
152
|
var args = Object();
|
|
141
153
|
if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
|
|
142
154
|
setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
|
|
143
155
|
}
|
|
156
|
+
if (!this.isLocal() && !isNullOrUndefined(property) &&
|
|
157
|
+
!isNullOrUndefined(property.isCollapsedStatePersist) &&
|
|
158
|
+
property.isCollapsedStatePersist === false) {
|
|
159
|
+
if (args.query && args.query.queries && args.query.queries.length) {
|
|
160
|
+
args.query.queries = args.query.queries.filter(function (q) {
|
|
161
|
+
if (q.fn === 'onWhere' && q.e) {
|
|
162
|
+
var preds = q.e;
|
|
163
|
+
if (preds && preds.field === _this.parent.parentIdMapping && (preds.value === null || preds.value === 'null')) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return true;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (args.query && args.query.params && args.query.params.length) {
|
|
171
|
+
args.query.params = args.query.params.filter(function (param) { return param.key !== 'IdMapping'; });
|
|
172
|
+
}
|
|
173
|
+
}
|
|
144
174
|
setValue('isExport', true, args);
|
|
145
175
|
if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
|
|
146
176
|
setValue('exportType', property.exportType, args);
|
|
@@ -123,7 +123,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
123
123
|
};
|
|
124
124
|
PdfExport.prototype.manipulatePdfProperties = function (prop, dtSrc, queryResult) {
|
|
125
125
|
var _this = this;
|
|
126
|
-
var args =
|
|
126
|
+
var args = Object();
|
|
127
127
|
//count not required for this query
|
|
128
128
|
var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
|
|
129
129
|
setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
|
|
@@ -1308,10 +1308,16 @@ var RowDD = /** @class */ (function () {
|
|
|
1308
1308
|
var droppedRecord = void 0;
|
|
1309
1309
|
if (isNullOrUndefined(args.dropIndex)) {
|
|
1310
1310
|
var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
|
|
1311
|
-
var
|
|
1311
|
+
var rowIndex_1 = tObj.selectedRowIndex === -1 ?
|
|
1312
1312
|
(this.parent.grid.getRowIndexByPrimaryKey(args.data[0]["" + primaryKeyField])) - 1
|
|
1313
1313
|
: tObj.getSelectedRowIndexes()[0] - 1;
|
|
1314
|
-
var record =
|
|
1314
|
+
var record = void 0;
|
|
1315
|
+
if (this.parent.enableVirtualization) {
|
|
1316
|
+
record = tObj.getCurrentViewRecords().find(function (e) { return e.index === rowIndex_1; });
|
|
1317
|
+
}
|
|
1318
|
+
else {
|
|
1319
|
+
record = tObj.getCurrentViewRecords()[parseInt(rowIndex_1.toString(), 10)];
|
|
1320
|
+
}
|
|
1315
1321
|
this.getParentData(record, args.data);
|
|
1316
1322
|
}
|
|
1317
1323
|
else {
|
|
@@ -773,7 +773,6 @@ var DataManipulation = /** @class */ (function () {
|
|
|
773
773
|
var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
|
|
774
774
|
var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
|
|
775
775
|
: results.length;
|
|
776
|
-
var qry = new Query();
|
|
777
776
|
var gridQuery = getObject('query', args);
|
|
778
777
|
var filterQuery;
|
|
779
778
|
var searchQuery;
|
|
@@ -789,11 +788,7 @@ var DataManipulation = /** @class */ (function () {
|
|
|
789
788
|
gridQuery = getValue('grid.renderModule.data', this.parent).filterQuery(gridQuery);
|
|
790
789
|
gridQuery = getValue('grid.renderModule.data', this.parent).searchQuery(gridQuery);
|
|
791
790
|
}
|
|
792
|
-
|
|
793
|
-
var srchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
|
|
794
|
-
qry.queries = fltrQuery.concat(srchQuery);
|
|
795
|
-
var filteredData = new DataManager(results).executeLocal(qry);
|
|
796
|
-
this.parent.notify('updateFilterRecs', { data: filteredData });
|
|
791
|
+
this.parent.getData({ query: gridQuery, isFilter: true });
|
|
797
792
|
results = this.dataResults.result;
|
|
798
793
|
this.dataResults.result = null;
|
|
799
794
|
if (this.parent.grid.aggregates.length > 0) {
|
|
@@ -818,34 +813,8 @@ var DataManipulation = /** @class */ (function () {
|
|
|
818
813
|
}
|
|
819
814
|
if (this.parent.grid.sortSettings.columns.length > 0 || this.isSortAction) {
|
|
820
815
|
this.isSortAction = false;
|
|
821
|
-
var parentData = this.parent.parentData;
|
|
822
816
|
var query = getObject('query', args);
|
|
823
|
-
|
|
824
|
-
for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
|
|
825
|
-
var getColumnByField = 'getColumnByField';
|
|
826
|
-
var col = this.parent.grid.renderModule.data["" + getColumnByField](this.parent.grid.
|
|
827
|
-
sortSettings.columns[parseInt(srt.toString(), 10)].field);
|
|
828
|
-
var compFun = col.sortComparer && isOffline(this.parent) ?
|
|
829
|
-
col.sortComparer.bind(col) :
|
|
830
|
-
this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].direction;
|
|
831
|
-
srtQry.sortBy(this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].field, compFun);
|
|
832
|
-
}
|
|
833
|
-
var modifiedData = new DataManager(parentData).executeLocal(srtQry);
|
|
834
|
-
if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&
|
|
835
|
-
this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
|
|
836
|
-
var dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
|
|
837
|
-
modifiedData.splice(dragdIndex, 1);
|
|
838
|
-
var dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
|
|
839
|
-
if (this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
|
|
840
|
-
modifiedData.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
|
|
841
|
-
}
|
|
842
|
-
else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
|
|
843
|
-
modifiedData.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: srtQry };
|
|
847
|
-
this.parent.notify('createSort', sortArgs);
|
|
848
|
-
results = sortArgs.modifiedData;
|
|
817
|
+
results = this.parent.getData({ query: query, isSort: true });
|
|
849
818
|
this.dataResults.result = null;
|
|
850
819
|
this.sortedData = results;
|
|
851
820
|
this.parent.notify('updateModel', {});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, ModuleDeclaration, extend, merge, SanitizeHtmlHelper} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue, NumberFormatOptions, DateFormatOptions } 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, getNumberFormat, RowSelectable } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';import { RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';import { LoadingIndicator } from '../models/loading-indicator';import { LoadingIndicatorModel } from '../models/loading-indicator-model';import { TextAlign } 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, RowDeselectingEventArgs, 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, AggregateQueryCellInfoEventArgs } 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, UrlAdaptor, Middlewares } 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, ActionEventArgs } from './interface';import { 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';import { TreeActionEventArgs } from '..';import * as literals from '../base/constant';import { ColumnChooserSettings } from '../models/column-chooser-settings';import { ColumnChooserSettingsModel } from '../models/column-chooser-settings-model';
|
|
1
|
+
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, ModuleDeclaration, extend, merge, SanitizeHtmlHelper} from '@syncfusion/ej2-base';import { removeClass, EmitType, Complex, Collection, KeyboardEventArgs, getValue, NumberFormatOptions, DateFormatOptions } 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, getNumberFormat, RowSelectable, LoadEventArgs, setEnableSeamlessScrolling } from '@syncfusion/ej2-grids';import { GridModel, ColumnQueryModeType, HeaderCellInfoEventArgs, EditSettingsModel as GridEditModel, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';import { RowDragEventArgs, RowDropEventArgs, RowDropSettingsModel, RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';import { LoadingIndicator } from '../models/loading-indicator';import { LoadingIndicatorModel } from '../models/loading-indicator-model';import { TextAlign } 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, RowDeselectingEventArgs, 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, AggregateQueryCellInfoEventArgs } 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, UrlAdaptor, Middlewares, QueryOptions, Predicate } 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, ActionEventArgs } from './interface';import { 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';import { TreeActionEventArgs } from '..';import * as literals from '../base/constant';import { ColumnChooserSettings } from '../models/column-chooser-settings';import { ColumnChooserSettingsModel } from '../models/column-chooser-settings-model';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -142,6 +142,8 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
142
142
|
isLocalData: boolean;
|
|
143
143
|
/** @hidden */
|
|
144
144
|
parentData: Object[];
|
|
145
|
+
/** @hidden */
|
|
146
|
+
enableSeamlessScrolling: boolean;
|
|
145
147
|
/**
|
|
146
148
|
* @hidden
|
|
147
149
|
*/
|
|
@@ -1490,6 +1492,38 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
1490
1492
|
private ignoreInArrays;
|
|
1491
1493
|
private ignoreInColumn;
|
|
1492
1494
|
private mouseClickHandler;
|
|
1495
|
+
/**
|
|
1496
|
+
* Retrieves all records that match the current search criteria and are sorted according to the active sort settings.
|
|
1497
|
+
*
|
|
1498
|
+
* This method processes the data source by applying search filters and sort operations,
|
|
1499
|
+
* returning the searched and sorted records excluding summary rows.
|
|
1500
|
+
*
|
|
1501
|
+
* @param {Object} args - Optional arguments object to control query execution behavior.
|
|
1502
|
+
* @param {Query} args.query - Optional custom Query object to override the default generated query.
|
|
1503
|
+
* @param {boolean} args.isFilter - Optional flag to include only filtered records without sorting (default: false).
|
|
1504
|
+
* @param {boolean} args.isSort - Optional flag to apply only sorting without filtering (default: false).
|
|
1505
|
+
*
|
|
1506
|
+
* @returns {ITreeData[]} - Array of searched and sorted TreeGrid records with summary rows excluded.
|
|
1507
|
+
* @hidden
|
|
1508
|
+
*/
|
|
1509
|
+
getData(args?: {
|
|
1510
|
+
query?: Query;
|
|
1511
|
+
isFilter?: boolean;
|
|
1512
|
+
isSort?: boolean;
|
|
1513
|
+
}): ITreeData[];
|
|
1514
|
+
/**
|
|
1515
|
+
* Retrieves the processed Tree Grid data based on current operations such as
|
|
1516
|
+
* sorting, filtering, and searching. Maintains hierarchy and current structure.
|
|
1517
|
+
*
|
|
1518
|
+
* For local data: when skipPage is true (the default), it returns all available records;
|
|
1519
|
+
* when skipPage is false, it returns only the records for the current page.
|
|
1520
|
+
* For remote data: it always returns only the records for the current page.
|
|
1521
|
+
*
|
|
1522
|
+
* @param {boolean} skipPage - if set to false, returns only the records for the current page.
|
|
1523
|
+
* @returns {ITreeData[]} - Array of tree records (summary rows excluded).
|
|
1524
|
+
* @hidden
|
|
1525
|
+
*/
|
|
1526
|
+
getProcessedRecords(skipPage?: boolean): ITreeData[];
|
|
1493
1527
|
/**
|
|
1494
1528
|
* Retrieves all the TreeGrid row elements.
|
|
1495
1529
|
*
|
|
@@ -21,7 +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 { getNumberFormat } from '@syncfusion/ej2-grids';
|
|
24
|
+
import { getNumberFormat, setEnableSeamlessScrolling } from '@syncfusion/ej2-grids';
|
|
25
25
|
import { Freeze as FreezeColumn } from '@syncfusion/ej2-grids';
|
|
26
26
|
import { RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';
|
|
27
27
|
import { LoadingIndicator } from '../models/loading-indicator';
|
|
@@ -35,7 +35,7 @@ import * as events from '../base/constant';
|
|
|
35
35
|
import { SearchSettings } from '../models/search-settings';
|
|
36
36
|
import { SelectionSettings } from '../models/selection-settings';
|
|
37
37
|
import { getActualProperties, getObject } from '@syncfusion/ej2-grids';
|
|
38
|
-
import { DataManager, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred, UrlAdaptor } from '@syncfusion/ej2-data';
|
|
38
|
+
import { DataManager, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred, UrlAdaptor, Predicate } from '@syncfusion/ej2-data';
|
|
39
39
|
import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
|
|
40
40
|
import { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';
|
|
41
41
|
import { Grid, Logger } from '@syncfusion/ej2-grids';
|
|
@@ -83,6 +83,8 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
83
83
|
_this.isComponentRefresh = false;
|
|
84
84
|
_this.isVirtualExpandCollapse = false;
|
|
85
85
|
_this.isInfiniteCollapse = false;
|
|
86
|
+
/** @hidden */
|
|
87
|
+
_this.enableSeamlessScrolling = false;
|
|
86
88
|
_this.objectEqualityChecker = function (old, current) {
|
|
87
89
|
if (old) {
|
|
88
90
|
var keys = Object.keys(old);
|
|
@@ -830,7 +832,15 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
830
832
|
this.renderModule = new Render(this);
|
|
831
833
|
this.dataModule = new DataManipulation(this);
|
|
832
834
|
this.printModule = new Print(this);
|
|
833
|
-
this.
|
|
835
|
+
if (this.enableVirtualization || this.enableColumnVirtualization) {
|
|
836
|
+
var args = { enableSeamlessScrolling: this.enableSeamlessScrolling };
|
|
837
|
+
this.trigger(events.load, args);
|
|
838
|
+
this.enableSeamlessScrolling = args.enableSeamlessScrolling;
|
|
839
|
+
setEnableSeamlessScrolling(this.enableSeamlessScrolling);
|
|
840
|
+
}
|
|
841
|
+
else {
|
|
842
|
+
this.trigger(events.load);
|
|
843
|
+
}
|
|
834
844
|
this.autoGenerateColumns();
|
|
835
845
|
this.initialRender = true;
|
|
836
846
|
if (!isNullOrUndefined(this.dataSource)) {
|
|
@@ -1103,6 +1113,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1103
1113
|
this.grid.clipMode = getActualProperties(this.clipMode);
|
|
1104
1114
|
this.grid.enableColumnSpan = this.enableColumnSpan;
|
|
1105
1115
|
this.grid.enableRowSpan = this.enableRowSpan;
|
|
1116
|
+
this.grid.enableSeamlessScrolling = this.enableSeamlessScrolling;
|
|
1106
1117
|
var templateInstance = 'templateDotnetInstance';
|
|
1107
1118
|
this.grid["" + templateInstance] = this["" + templateInstance];
|
|
1108
1119
|
var isJsComponent = 'isJsComponent';
|
|
@@ -1580,7 +1591,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1580
1591
|
}
|
|
1581
1592
|
_this.notify('updateGridActions', args);
|
|
1582
1593
|
_this.isVirtualExpandCollapse = false;
|
|
1583
|
-
if (args.requestType === 'save' && _this.aggregates.
|
|
1594
|
+
if (args.requestType === 'save' && _this.aggregates.some(function (ag) { return ag.showChildSummary === true; })) {
|
|
1584
1595
|
_this.grid.refresh();
|
|
1585
1596
|
}
|
|
1586
1597
|
if ((args.action === 'clearFilter' || args.action === 'clear-filter' || args.requestType === 'sorting') && _this.enableInfiniteScrolling) {
|
|
@@ -2326,6 +2337,115 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2326
2337
|
}
|
|
2327
2338
|
}
|
|
2328
2339
|
};
|
|
2340
|
+
/**
|
|
2341
|
+
* Retrieves all records that match the current search criteria and are sorted according to the active sort settings.
|
|
2342
|
+
*
|
|
2343
|
+
* This method processes the data source by applying search filters and sort operations,
|
|
2344
|
+
* returning the searched and sorted records excluding summary rows.
|
|
2345
|
+
*
|
|
2346
|
+
* @param {Object} args - Optional arguments object to control query execution behavior.
|
|
2347
|
+
* @param {Query} args.query - Optional custom Query object to override the default generated query.
|
|
2348
|
+
* @param {boolean} args.isFilter - Optional flag to include only filtered records without sorting (default: false).
|
|
2349
|
+
* @param {boolean} args.isSort - Optional flag to apply only sorting without filtering (default: false).
|
|
2350
|
+
*
|
|
2351
|
+
* @returns {ITreeData[]} - Array of searched and sorted TreeGrid records with summary rows excluded.
|
|
2352
|
+
* @hidden
|
|
2353
|
+
*/
|
|
2354
|
+
TreeGrid.prototype.getData = function (args) {
|
|
2355
|
+
var dataObj = isCountRequired(this) ? getValue('result', this.grid.dataSource)
|
|
2356
|
+
: this.grid.dataSource;
|
|
2357
|
+
var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
|
|
2358
|
+
var gridQuery = (!isNullOrUndefined(args) && args.query) ? args.query : this.getDataModule().baseModule.generateQuery();
|
|
2359
|
+
var filterQuery;
|
|
2360
|
+
var searchQuery;
|
|
2361
|
+
if (!isNullOrUndefined(gridQuery)) {
|
|
2362
|
+
filterQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
|
|
2363
|
+
searchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
|
|
2364
|
+
}
|
|
2365
|
+
var skipFilterSearch = (!isNullOrUndefined(args) && args.isSort);
|
|
2366
|
+
if (!skipFilterSearch && (this.grid.allowFiltering && this.grid.filterSettings.columns.length) ||
|
|
2367
|
+
(this.grid.searchSettings.key.length > 0) && (!isNullOrUndefined(gridQuery))
|
|
2368
|
+
|| ((filterQuery && filterQuery.length > 0) || (searchQuery && searchQuery.length > 0))) {
|
|
2369
|
+
var filterQuery_1 = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
|
|
2370
|
+
var searchQuery_1 = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
|
|
2371
|
+
var query = new Query();
|
|
2372
|
+
query.queries = filterQuery_1.concat(searchQuery_1);
|
|
2373
|
+
var filteredData = new DataManager(results).executeLocal(query);
|
|
2374
|
+
this.notify('updateFilterRecs', { data: filteredData });
|
|
2375
|
+
results = isRemoteData(this) ? this.dataResults : this.filterModule.filteredResult;
|
|
2376
|
+
if (!isNullOrUndefined(args) && args.isFilter) {
|
|
2377
|
+
return isRemoteData(this) ? results.result.filter(function (item) { return !item.isSummaryRow; })
|
|
2378
|
+
: results.filter(function (item) { return !item.isSummaryRow; });
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
var sortQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSortBy'; });
|
|
2382
|
+
if (this.grid.sortSettings.columns.length > 0 || sortQuery.length) {
|
|
2383
|
+
var parentData = this.parentData;
|
|
2384
|
+
var query = new Query();
|
|
2385
|
+
query.queries = sortQuery;
|
|
2386
|
+
var modifiedData = new DataManager(parentData).executeLocal(query);
|
|
2387
|
+
if (this.allowRowDragAndDrop && !isNullOrUndefined(this.rowDragAndDropModule['draggedRecord']) &&
|
|
2388
|
+
this.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
|
|
2389
|
+
var dragdIndex = modifiedData.indexOf(this.rowDragAndDropModule['draggedRecord']);
|
|
2390
|
+
modifiedData.splice(dragdIndex, 1);
|
|
2391
|
+
var dropdIndex = modifiedData.indexOf(this.rowDragAndDropModule['droppedRecord']);
|
|
2392
|
+
if (this.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.rowDragAndDropModule['dropPosition'] === 'topSegment') {
|
|
2393
|
+
modifiedData.splice(dropdIndex, 0, this.rowDragAndDropModule['draggedRecord']);
|
|
2394
|
+
}
|
|
2395
|
+
else if (this.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
|
|
2396
|
+
modifiedData.splice(dropdIndex + 1, 0, this.rowDragAndDropModule['draggedRecord']);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: query };
|
|
2400
|
+
this.notify('createSort', sortArgs);
|
|
2401
|
+
results = isRemoteData(this) ? this.dataResults : sortArgs.modifiedData;
|
|
2402
|
+
}
|
|
2403
|
+
return isRemoteData(this) ? this.dataResults.result.filter(function (item) { return !item.isSummaryRow; })
|
|
2404
|
+
: results.filter(function (item) { return !item.isSummaryRow; });
|
|
2405
|
+
};
|
|
2406
|
+
/**
|
|
2407
|
+
* Retrieves the processed Tree Grid data based on current operations such as
|
|
2408
|
+
* sorting, filtering, and searching. Maintains hierarchy and current structure.
|
|
2409
|
+
*
|
|
2410
|
+
* For local data: when skipPage is true (the default), it returns all available records;
|
|
2411
|
+
* when skipPage is false, it returns only the records for the current page.
|
|
2412
|
+
* For remote data: it always returns only the records for the current page.
|
|
2413
|
+
*
|
|
2414
|
+
* @param {boolean} skipPage - if set to false, returns only the records for the current page.
|
|
2415
|
+
* @returns {ITreeData[]} - Array of tree records (summary rows excluded).
|
|
2416
|
+
* @hidden
|
|
2417
|
+
*/
|
|
2418
|
+
TreeGrid.prototype.getProcessedRecords = function (skipPage) {
|
|
2419
|
+
var _this = this;
|
|
2420
|
+
var result;
|
|
2421
|
+
if (skipPage !== true || isRemoteData(this)) {
|
|
2422
|
+
result = this.getData();
|
|
2423
|
+
var dm = new DataManager(result);
|
|
2424
|
+
var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
|
|
2425
|
+
var parents_1 = dm.executeLocal(new Query().where(expanded));
|
|
2426
|
+
var visualData = parents_1.filter(function (e) {
|
|
2427
|
+
return getExpandStatus(_this, e, parents_1);
|
|
2428
|
+
});
|
|
2429
|
+
var query = new Query();
|
|
2430
|
+
if (this.allowPaging || this.enableVirtualization || this.enableInfiniteScrolling) {
|
|
2431
|
+
var pageSize = this.grid.pageSettings.pageSize;
|
|
2432
|
+
var currentPage = this.grid.pageSettings.currentPage;
|
|
2433
|
+
if (visualData.length < (currentPage * pageSize)) {
|
|
2434
|
+
currentPage = (Math.floor(visualData.length / pageSize)) + ((visualData.length % pageSize) ? 1 : 0);
|
|
2435
|
+
currentPage = currentPage ? currentPage : 1;
|
|
2436
|
+
this.grid.setProperties({ pageSettings: { currentPage: currentPage } }, true);
|
|
2437
|
+
}
|
|
2438
|
+
var skip = pageSize * (currentPage - 1);
|
|
2439
|
+
query = query.skip(skip).take(pageSize);
|
|
2440
|
+
}
|
|
2441
|
+
dm.dataSource.json = visualData;
|
|
2442
|
+
result = dm.executeLocal(query);
|
|
2443
|
+
}
|
|
2444
|
+
else {
|
|
2445
|
+
result = this.getData();
|
|
2446
|
+
}
|
|
2447
|
+
return result;
|
|
2448
|
+
};
|
|
2329
2449
|
/**
|
|
2330
2450
|
* Retrieves all the TreeGrid row elements.
|
|
2331
2451
|
*
|
|
@@ -2582,11 +2702,6 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2582
2702
|
rowData.hasChildRecords = record.hasChildRecords;
|
|
2583
2703
|
rowData.parentUniqueID = record.parentUniqueID;
|
|
2584
2704
|
rowData.expanded = record.expanded;
|
|
2585
|
-
if (this.enableVirtualization) {
|
|
2586
|
-
this.grid.selectionModule.selectedRowIndexes = this.grid.selectionModule.selectedRowIndexes.indexOf(record.index) === -1
|
|
2587
|
-
&& (this.selectedRowIndex >= 0 && this.selectedRowIndex !== record.index) ? [record.index] :
|
|
2588
|
-
this.grid.selectionModule.selectedRowIndexes;
|
|
2589
|
-
}
|
|
2590
2705
|
this.grid.setRowData(key, rowData);
|
|
2591
2706
|
var visibleRecords = this.getVisibleRecords();
|
|
2592
2707
|
if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])["" + primaryKey]) {
|
|
@@ -96,6 +96,7 @@ export declare class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
96
96
|
* @returns {void}
|
|
97
97
|
*/
|
|
98
98
|
private cellFocus;
|
|
99
|
+
private updateScrollbar;
|
|
99
100
|
/**
|
|
100
101
|
* Handles the data ready event for the virtual tree grid content renderer.
|
|
101
102
|
*
|
|
@@ -317,16 +318,14 @@ export declare class VirtualTreeContentRenderer extends VirtualContentRenderer {
|
|
|
317
318
|
* @returns {void}
|
|
318
319
|
*/
|
|
319
320
|
removeEventListener(): void;
|
|
321
|
+
destroy(): void;
|
|
320
322
|
}
|
|
321
323
|
export declare class TreeInterSectionObserver extends InterSectionObserver {
|
|
322
324
|
private isWheeling;
|
|
323
325
|
private newPos;
|
|
324
326
|
private lastPos;
|
|
325
327
|
private timer;
|
|
326
|
-
private
|
|
327
|
-
private movableContainerEl;
|
|
328
|
-
private containerScrollHandler;
|
|
329
|
-
private movableScrollHandler;
|
|
328
|
+
private onWheelEvent;
|
|
330
329
|
/**
|
|
331
330
|
* Sets up observers to monitor scroll events on a given container
|
|
332
331
|
* and its movable companion within a virtual grid setup.
|
|
@@ -337,7 +336,7 @@ export declare class TreeInterSectionObserver extends InterSectionObserver {
|
|
|
337
336
|
* @returns {void}
|
|
338
337
|
*/
|
|
339
338
|
observes(callback: Function, onEnterCallback: Function, instance: IGrid): void;
|
|
340
|
-
|
|
339
|
+
private onVirtualContentScrolling;
|
|
341
340
|
/**
|
|
342
341
|
* Clears the last known position.
|
|
343
342
|
*
|