@syncfusion/ej2-treegrid 19.4.48 → 19.4.54
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/CHANGELOG.md +20 -0
- 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 +114 -21
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +114 -19
- 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/crud-actions.js +5 -0
- package/src/treegrid/actions/infinite-scroll.d.ts +1 -0
- package/src/treegrid/actions/infinite-scroll.js +24 -2
- package/src/treegrid/actions/rowdragdrop.js +11 -0
- package/src/treegrid/actions/toolbar.d.ts +1 -0
- package/src/treegrid/actions/toolbar.js +39 -4
- package/src/treegrid/base/treegrid-model.d.ts +1 -1
- package/src/treegrid/base/treegrid.d.ts +3 -0
- package/src/treegrid/base/treegrid.js +36 -14
- package/src/treegrid/models/rowdrop-settings-model.d.ts +1 -1
- package/src/treegrid/models/rowdrop-settings.d.ts +7 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 19.4.
|
|
3
|
+
* version : 19.4.54
|
|
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.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-treegrid@19.4.52",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-B6Doo437VJTVspTB15gVZ40BpaqThNJQJ6/Gl/Ei7zTnJY6Tg/NEyW8hajktphWX264WotqDWdruY1UfNY6pkA==",
|
|
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.4.
|
|
28
|
-
"_shasum": "
|
|
27
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.4.52.tgz",
|
|
28
|
+
"_shasum": "88f378640e61e1f0fb7be34f3f84685a3b015430",
|
|
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.4.
|
|
40
|
-
"@syncfusion/ej2-data": "~19.4.
|
|
41
|
-
"@syncfusion/ej2-grids": "~19.4.
|
|
42
|
-
"@syncfusion/ej2-popups": "~19.4.
|
|
39
|
+
"@syncfusion/ej2-base": "~19.4.52",
|
|
40
|
+
"@syncfusion/ej2-data": "~19.4.54",
|
|
41
|
+
"@syncfusion/ej2-grids": "~19.4.54",
|
|
42
|
+
"@syncfusion/ej2-popups": "~19.4.53"
|
|
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.4.
|
|
63
|
+
"version": "19.4.54",
|
|
64
64
|
"sideEffects": false
|
|
65
65
|
}
|
|
@@ -381,6 +381,11 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
|
|
|
381
381
|
column: control.grid.getColumns()[control.treeColumnIndex],
|
|
382
382
|
requestType: action
|
|
383
383
|
});
|
|
384
|
+
if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {
|
|
385
|
+
control.renderModule.RowModifier({
|
|
386
|
+
data: record, row: row
|
|
387
|
+
});
|
|
388
|
+
}
|
|
384
389
|
}
|
|
385
390
|
}
|
|
386
391
|
}
|
|
@@ -3,7 +3,7 @@ import { RowRenderer, resetRowIndex } from '@syncfusion/ej2-grids';
|
|
|
3
3
|
import { getValue, isNullOrUndefined, remove } from '@syncfusion/ej2-base';
|
|
4
4
|
import * as events from '../base/constant';
|
|
5
5
|
import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
|
|
6
|
-
import { findChildrenRecords } from '../utils';
|
|
6
|
+
import { findChildrenRecords, getExpandStatus } from '../utils';
|
|
7
7
|
/**
|
|
8
8
|
* TreeGrid Infinite Scroll module will handle Infinite Scrolling.
|
|
9
9
|
*
|
|
@@ -40,6 +40,7 @@ var InfiniteScroll = /** @class */ (function () {
|
|
|
40
40
|
this.parent.grid.on('infinite-edit-handler', this.infiniteEditHandler, this);
|
|
41
41
|
this.parent.grid.on('infinite-crud-cancel', this.createRows, this);
|
|
42
42
|
this.parent.grid.on('content-ready', this.contentready, this);
|
|
43
|
+
this.parent.on(events.localPagedExpandCollapse, this.collapseExpandInfinitechilds, this);
|
|
43
44
|
};
|
|
44
45
|
/**
|
|
45
46
|
* @hidden
|
|
@@ -55,6 +56,7 @@ var InfiniteScroll = /** @class */ (function () {
|
|
|
55
56
|
this.parent.off(events.pagingActions, this.infinitePageAction);
|
|
56
57
|
this.parent.grid.off('infinite-crud-cancel', this.createRows);
|
|
57
58
|
this.parent.grid.off('content-ready', this.contentready);
|
|
59
|
+
this.parent.off(events.localPagedExpandCollapse, this.collapseExpandInfinitechilds);
|
|
58
60
|
};
|
|
59
61
|
/**
|
|
60
62
|
* Handles the Expand Collapse action for Remote data with infinite scrolling.
|
|
@@ -104,6 +106,18 @@ var InfiniteScroll = /** @class */ (function () {
|
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
};
|
|
109
|
+
InfiniteScroll.prototype.collapseExpandInfinitechilds = function (row) {
|
|
110
|
+
row.record.expanded = row.action === 'collapse' ? false : true;
|
|
111
|
+
var ret = {
|
|
112
|
+
result: this.parent.flatData,
|
|
113
|
+
row: row.row,
|
|
114
|
+
action: row.action,
|
|
115
|
+
record: row.record,
|
|
116
|
+
count: this.parent.flatData.length
|
|
117
|
+
};
|
|
118
|
+
var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
|
|
119
|
+
getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
|
|
120
|
+
};
|
|
107
121
|
/**
|
|
108
122
|
* Handles the page query for Data operations and CRUD actions.
|
|
109
123
|
*
|
|
@@ -114,9 +128,13 @@ var InfiniteScroll = /** @class */ (function () {
|
|
|
114
128
|
* @returns {void}
|
|
115
129
|
*/
|
|
116
130
|
InfiniteScroll.prototype.infinitePageAction = function (pageingDetails) {
|
|
131
|
+
var _this = this;
|
|
117
132
|
var dm = new DataManager(pageingDetails.result);
|
|
118
133
|
var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
|
|
119
|
-
var
|
|
134
|
+
var infiniteParents = dm.executeLocal(new Query().where(expanded));
|
|
135
|
+
var visualData = infiniteParents.filter(function (e) {
|
|
136
|
+
return getExpandStatus(_this.parent, e, infiniteParents);
|
|
137
|
+
});
|
|
120
138
|
var actionArgs = getValue('actionArgs', pageingDetails.actionArgs);
|
|
121
139
|
var actions = getValue('actions', this.parent.grid.infiniteScrollModule);
|
|
122
140
|
var initial = actions.some(function (value) { return value === actionArgs.requestType; });
|
|
@@ -150,6 +168,10 @@ var InfiniteScroll = /** @class */ (function () {
|
|
|
150
168
|
query = query.take(this.parent.infiniteScrollSettings.initialBlocks * this.parent.pageSettings.pageSize);
|
|
151
169
|
}
|
|
152
170
|
else {
|
|
171
|
+
if ((pageingDetails.actionArgs['action'] === 'expand' || pageingDetails.actionArgs['action'] === 'collapse') && this.parent.grid.pageSettings.currentPage !== 1) {
|
|
172
|
+
current = 1;
|
|
173
|
+
size = this.parent.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;
|
|
174
|
+
}
|
|
153
175
|
query = query.page(current, size);
|
|
154
176
|
}
|
|
155
177
|
}
|
|
@@ -60,6 +60,7 @@ var RowDD = /** @class */ (function () {
|
|
|
60
60
|
*/
|
|
61
61
|
RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
62
62
|
var tObj = this.parent;
|
|
63
|
+
var action = 'action';
|
|
63
64
|
if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
|
|
64
65
|
if (position === 'above') {
|
|
65
66
|
this.dropPosition = 'topSegment';
|
|
@@ -86,6 +87,11 @@ var RowDD = /** @class */ (function () {
|
|
|
86
87
|
if (tObj.isLocalData) {
|
|
87
88
|
tObj.flatData = this.orderToIndex(tObj.flatData);
|
|
88
89
|
}
|
|
90
|
+
if (this.parent[action] === 'outdenting') {
|
|
91
|
+
if (!isNullOrUndefined(data[0].parentItem)) {
|
|
92
|
+
data[0].level = data[0].parentItem.level + 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
89
95
|
this.parent.grid.refresh();
|
|
90
96
|
if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {
|
|
91
97
|
var index = this.parent.treeColumnIndex + 1;
|
|
@@ -106,6 +112,11 @@ var RowDD = /** @class */ (function () {
|
|
|
106
112
|
column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
|
|
107
113
|
requestType: 'rowDragAndDrop'
|
|
108
114
|
});
|
|
115
|
+
if (this.parent[action] === 'indenting' || this.parent[action] === 'outdenting') {
|
|
116
|
+
this.parent.renderModule.RowModifier({
|
|
117
|
+
data: totalRecord[i], row: rows[i]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
109
120
|
}
|
|
110
121
|
}
|
|
111
122
|
}
|
|
@@ -27,6 +27,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
27
27
|
*/
|
|
28
28
|
Toolbar.prototype.addEventListener = function () {
|
|
29
29
|
this.parent.on(events.rowSelected, this.refreshToolbar, this);
|
|
30
|
+
this.parent.on(events.rowDeselected, this.refreshToolbar, this);
|
|
30
31
|
this.parent.on(events.toolbarClick, this.toolbarClickHandler, this);
|
|
31
32
|
};
|
|
32
33
|
/**
|
|
@@ -38,6 +39,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
41
|
this.parent.off(events.rowSelected, this.refreshToolbar);
|
|
42
|
+
this.parent.off(events.rowDeselected, this.refreshToolbar);
|
|
41
43
|
this.parent.off(events.toolbarClick, this.toolbarClickHandler);
|
|
42
44
|
};
|
|
43
45
|
Toolbar.prototype.refreshToolbar = function (args) {
|
|
@@ -45,7 +47,7 @@ var Toolbar = /** @class */ (function () {
|
|
|
45
47
|
if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {
|
|
46
48
|
this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);
|
|
47
49
|
}
|
|
48
|
-
else {
|
|
50
|
+
else if (args['name'] !== "rowDeselected") {
|
|
49
51
|
if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {
|
|
50
52
|
if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&
|
|
51
53
|
(tObj.getCurrentViewRecords()[args.row.rowIndex].level >
|
|
@@ -67,12 +69,21 @@ var Toolbar = /** @class */ (function () {
|
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
}
|
|
72
|
+
if (args['name'] === "rowDeselected") {
|
|
73
|
+
if (this.parent.toolbar['includes']('Indent')) {
|
|
74
|
+
this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
|
|
75
|
+
}
|
|
76
|
+
if (this.parent.toolbar['includes']('Outdent')) {
|
|
77
|
+
this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
70
80
|
if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {
|
|
71
81
|
this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
|
|
72
82
|
}
|
|
73
83
|
};
|
|
74
84
|
Toolbar.prototype.toolbarClickHandler = function (args) {
|
|
75
85
|
var tObj = this.parent;
|
|
86
|
+
var action = 'action';
|
|
76
87
|
if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.editSettings.mode === 'Batch' &&
|
|
77
88
|
args.item.id === this.parent.grid.element.id + '_update') {
|
|
78
89
|
args.cancel = true;
|
|
@@ -97,10 +108,10 @@ var Toolbar = /** @class */ (function () {
|
|
|
97
108
|
else {
|
|
98
109
|
dropIndex = tObj.getSelectedRowIndexes()[0] - 1;
|
|
99
110
|
}
|
|
100
|
-
|
|
111
|
+
this.parent[action] = 'indenting';
|
|
112
|
+
this.eventTrigger('indenting', dropIndex);
|
|
101
113
|
}
|
|
102
114
|
if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {
|
|
103
|
-
var index = tObj.getSelectedRowIndexes()[0];
|
|
104
115
|
var dropIndex = void 0;
|
|
105
116
|
var parentItem = tObj.getSelectedRecords()[0].parentItem;
|
|
106
117
|
for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {
|
|
@@ -108,9 +119,33 @@ var Toolbar = /** @class */ (function () {
|
|
|
108
119
|
dropIndex = i;
|
|
109
120
|
}
|
|
110
121
|
}
|
|
111
|
-
|
|
122
|
+
this.parent[action] = 'outdenting';
|
|
123
|
+
this.eventTrigger('outdenting', dropIndex);
|
|
112
124
|
}
|
|
113
125
|
};
|
|
126
|
+
Toolbar.prototype.eventTrigger = function (action, dropIndex) {
|
|
127
|
+
var _this = this;
|
|
128
|
+
var selectedRecords = 'selectedRecords';
|
|
129
|
+
var selectedRows = 'selectedRows';
|
|
130
|
+
this.parent[selectedRows] = this.parent.getSelectedRows();
|
|
131
|
+
this.parent[selectedRecords] = this.parent.getSelectedRecords();
|
|
132
|
+
var actionArgs = {
|
|
133
|
+
requestType: action,
|
|
134
|
+
data: this.parent.getSelectedRecords(),
|
|
135
|
+
row: this.parent.getSelectedRows(),
|
|
136
|
+
cancel: false
|
|
137
|
+
};
|
|
138
|
+
this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
|
|
139
|
+
if (!actionArgs.cancel) {
|
|
140
|
+
if (actionArgs.requestType === 'indenting') {
|
|
141
|
+
_this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');
|
|
142
|
+
}
|
|
143
|
+
else if (actionArgs.requestType === 'outdenting') {
|
|
144
|
+
_this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
};
|
|
114
149
|
/**
|
|
115
150
|
* Gets the toolbar of the TreeGrid.
|
|
116
151
|
*
|
|
@@ -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, 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';
|
|
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';import { TreeActionEventArgs } from '..';
|
|
2
2
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -86,6 +86,9 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
|
|
|
86
86
|
* The `sortModule` is used to manipulate sorting in TreeGrid.
|
|
87
87
|
*/
|
|
88
88
|
sortModule: Sort;
|
|
89
|
+
private action;
|
|
90
|
+
private selectedRecords;
|
|
91
|
+
private selectedRows;
|
|
89
92
|
private loggerModule;
|
|
90
93
|
private isSelfReference;
|
|
91
94
|
private columnModel;
|
|
@@ -743,6 +743,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
743
743
|
};
|
|
744
744
|
this.grid.rowDeselected = function (args) {
|
|
745
745
|
_this.selectedRowIndex = _this.grid.selectedRowIndex;
|
|
746
|
+
if (!isNullOrUndefined(args.data)) {
|
|
747
|
+
_this.notify(events.rowDeselected, args);
|
|
748
|
+
}
|
|
746
749
|
_this.trigger(events.rowDeselected, args);
|
|
747
750
|
};
|
|
748
751
|
this.grid.resizeStop = function (args) {
|
|
@@ -1061,14 +1064,16 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1061
1064
|
_this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();
|
|
1062
1065
|
}
|
|
1063
1066
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1067
|
+
if (_this.action !== 'indenting' && _this.action !== 'outdenting') {
|
|
1068
|
+
var callBackPromise_2 = new Deferred();
|
|
1069
|
+
_this.trigger(events.actionBegin, args, function (actionArgs) {
|
|
1070
|
+
if (!actionArgs.cancel) {
|
|
1071
|
+
_this.notify(events.beginEdit, actionArgs);
|
|
1072
|
+
}
|
|
1073
|
+
callBackPromise_2.resolve(actionArgs);
|
|
1074
|
+
});
|
|
1075
|
+
return callBackPromise_2;
|
|
1076
|
+
}
|
|
1072
1077
|
};
|
|
1073
1078
|
this.grid.actionComplete = function (args) {
|
|
1074
1079
|
_this.notify('actioncomplete', args);
|
|
@@ -1088,7 +1093,20 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1088
1093
|
if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
|
|
1089
1094
|
_this.grid.refresh();
|
|
1090
1095
|
}
|
|
1091
|
-
_this.
|
|
1096
|
+
if (_this.action === 'indenting' || _this.action === 'outdenting') {
|
|
1097
|
+
_this.action = _this.action === 'indenting' ? 'indented' : 'outdented';
|
|
1098
|
+
var actionArgs = {
|
|
1099
|
+
requestType: _this.action,
|
|
1100
|
+
data: _this.selectedRecords,
|
|
1101
|
+
row: _this.selectedRows
|
|
1102
|
+
};
|
|
1103
|
+
_this.trigger(events.actionComplete, actionArgs);
|
|
1104
|
+
_this.action = '';
|
|
1105
|
+
_this.selectedRecords = _this.selectedRows = [];
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
_this.trigger(events.actionComplete, args);
|
|
1109
|
+
}
|
|
1092
1110
|
};
|
|
1093
1111
|
};
|
|
1094
1112
|
TreeGrid.prototype.extendedGridEvents = function () {
|
|
@@ -1288,7 +1306,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1288
1306
|
case ToolbarItem.RowIndent:
|
|
1289
1307
|
tooltipText = this.l10n.getConstant('RowIndent');
|
|
1290
1308
|
items.push({
|
|
1291
|
-
text: tooltipText, tooltipText: tooltipText,
|
|
1309
|
+
text: tooltipText, tooltipText: tooltipText, disabled: true,
|
|
1292
1310
|
prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'
|
|
1293
1311
|
});
|
|
1294
1312
|
break;
|
|
@@ -1296,7 +1314,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1296
1314
|
case ToolbarItem.RowOutdent:
|
|
1297
1315
|
tooltipText = this.l10n.getConstant('RowOutdent');
|
|
1298
1316
|
items.push({
|
|
1299
|
-
text: tooltipText, tooltipText: tooltipText,
|
|
1317
|
+
text: tooltipText, tooltipText: tooltipText, disabled: true,
|
|
1300
1318
|
prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'
|
|
1301
1319
|
});
|
|
1302
1320
|
break;
|
|
@@ -1898,6 +1916,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1898
1916
|
rowData.parentUniqueID = record.parentUniqueID;
|
|
1899
1917
|
rowData.expanded = record.expanded;
|
|
1900
1918
|
this.grid.setRowData(key, rowData);
|
|
1919
|
+
var table = this.getContentTable();
|
|
1920
|
+
var sHeight = table.scrollHeight;
|
|
1921
|
+
var clientHeight = this.getContent().clientHeight;
|
|
1922
|
+
this.lastRowBorder(this.getRows()[record.index], sHeight <= clientHeight);
|
|
1901
1923
|
};
|
|
1902
1924
|
/**
|
|
1903
1925
|
* Navigates to the specified target page.
|
|
@@ -2664,7 +2686,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2664
2686
|
}
|
|
2665
2687
|
this.isExpandAll = true;
|
|
2666
2688
|
this.isCollapseAll = true;
|
|
2667
|
-
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
|
|
2689
|
+
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {
|
|
2668
2690
|
this.flatData.filter(function (e) {
|
|
2669
2691
|
if (e.hasChildRecords) {
|
|
2670
2692
|
e.expanded = action === 'collapse' ? false : true;
|
|
@@ -2723,7 +2745,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2723
2745
|
if (!isNullOrUndefined(row)) {
|
|
2724
2746
|
row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
|
|
2725
2747
|
}
|
|
2726
|
-
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)
|
|
2748
|
+
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)
|
|
2727
2749
|
&& !isCountRequired(this)) {
|
|
2728
2750
|
this.notify(events.localPagedExpandCollapse, { action: action, row: row, record: record });
|
|
2729
2751
|
}
|
|
@@ -2786,7 +2808,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2786
2808
|
var totalRows = this.getRows();
|
|
2787
2809
|
var rows = this.getContentTable().rows;
|
|
2788
2810
|
totalRows = [].slice.call(rows);
|
|
2789
|
-
for (var i = totalRows.length - 1; i
|
|
2811
|
+
for (var i = totalRows.length - 1; i >= 0; i--) {
|
|
2790
2812
|
if (!isHidden(totalRows[i])) {
|
|
2791
2813
|
var table = this.getContentTable();
|
|
2792
2814
|
var sHeight = table.scrollHeight;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChildProperty } from '@syncfusion/ej2-base';
|
|
2
|
+
import { ITreeData } from '..';
|
|
2
3
|
/**
|
|
3
4
|
* Configures the row drop settings of the TreeGrid.
|
|
4
5
|
*/
|
|
@@ -10,3 +11,9 @@ export declare class RowDropSettings extends ChildProperty<RowDropSettings> {
|
|
|
10
11
|
*/
|
|
11
12
|
targetID: string;
|
|
12
13
|
}
|
|
14
|
+
export interface TreeActionEventArgs {
|
|
15
|
+
requestType?: string;
|
|
16
|
+
data?: ITreeData[];
|
|
17
|
+
row?: Object[];
|
|
18
|
+
cancel?: boolean;
|
|
19
|
+
}
|