@syncfusion/ej2-treegrid 25.2.5 → 26.1.35-469198
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/.eslintrc.json +243 -259
- package/README.md +83 -83
- package/dist/ej2-treegrid.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js +1 -10
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +706 -532
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +1222 -1047
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +1 -10
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/dist/ts/undefined +602 -0
- package/license +9 -9
- package/package.json +70 -70
- package/src/treegrid/actions/clipboard.js +13 -13
- package/src/treegrid/actions/edit.js +8 -7
- package/src/treegrid/actions/excel-export.js +4 -3
- package/src/treegrid/actions/logger.js +13 -13
- package/src/treegrid/actions/page.js +4 -0
- package/src/treegrid/actions/rowdragdrop.js +29 -14
- package/src/treegrid/actions/selection.js +4 -1
- package/src/treegrid/actions/virtual-scroll.js +13 -13
- package/src/treegrid/base/constant.js +2 -0
- package/src/treegrid/base/data.js +2 -1
- package/src/treegrid/base/interface.js +0 -1
- package/src/treegrid/base/treegrid-model.d.ts +875 -875
- package/src/treegrid/base/treegrid.js +260 -92
- package/src/treegrid/models/column-model.d.ts +6 -6
- package/src/treegrid/models/column.js +19 -19
- package/src/treegrid/models/edit-settings-model.d.ts +72 -72
- package/src/treegrid/models/edit-settings.js +19 -19
- package/src/treegrid/models/filter-settings-model.d.ts +206 -206
- package/src/treegrid/models/filter-settings.js +19 -19
- package/src/treegrid/models/infinite-scroll-settings-model.d.ts +16 -16
- package/src/treegrid/models/infinite-scroll-settings.js +19 -19
- package/src/treegrid/models/loading-indicator.js +19 -19
- package/src/treegrid/models/page-settings-model.d.ts +46 -46
- package/src/treegrid/models/page-settings.js +19 -19
- package/src/treegrid/models/rowdrop-settings-model.d.ts +6 -6
- package/src/treegrid/models/rowdrop-settings.js +19 -19
- package/src/treegrid/models/search-settings-model.d.ts +60 -60
- package/src/treegrid/models/search-settings.js +19 -19
- package/src/treegrid/models/selection-settings-model.d.ts +66 -66
- package/src/treegrid/models/selection-settings.js +19 -19
- package/src/treegrid/models/sort-settings-model.d.ts +24 -24
- package/src/treegrid/models/sort-settings.js +19 -19
- package/src/treegrid/models/summary-model.d.ts +64 -64
- package/src/treegrid/models/summary.js +19 -19
- package/src/treegrid/models/textwrap-settings-model.d.ts +9 -9
- package/src/treegrid/models/textwrap-settings.js +19 -19
- package/src/treegrid/renderer/render.js +3 -1
- package/src/treegrid/renderer/virtual-row-model-generator.js +15 -15
- package/src/treegrid/renderer/virtual-tree-content-render.js +15 -14
- package/styles/bds-lite.css +745 -0
- package/styles/bds-lite.scss +18 -0
- package/styles/bds.css +765 -0
- package/styles/bds.scss +19 -0
- package/styles/bootstrap-dark-lite.css +506 -0
- package/styles/bootstrap-dark-lite.scss +18 -0
- package/styles/bootstrap-dark.css +187 -117
- package/styles/bootstrap-dark.scss +19 -1
- package/styles/bootstrap-lite.css +509 -0
- package/styles/bootstrap-lite.scss +18 -0
- package/styles/bootstrap.css +190 -121
- package/styles/bootstrap.scss +19 -1
- package/styles/bootstrap4-lite.css +550 -0
- package/styles/bootstrap4-lite.scss +18 -0
- package/styles/bootstrap4.css +194 -133
- package/styles/bootstrap4.scss +19 -1
- package/styles/bootstrap5-dark-lite.css +545 -0
- package/styles/bootstrap5-dark-lite.scss +18 -0
- package/styles/bootstrap5-dark.css +189 -123
- package/styles/bootstrap5-dark.scss +19 -1
- package/styles/bootstrap5-lite.css +545 -0
- package/styles/bootstrap5-lite.scss +18 -0
- package/styles/bootstrap5.3-lite.css +1637 -0
- package/styles/bootstrap5.3-lite.scss +18 -0
- package/styles/bootstrap5.3.css +1657 -0
- package/styles/bootstrap5.3.scss +19 -0
- package/styles/bootstrap5.css +188 -122
- package/styles/bootstrap5.scss +19 -1
- package/styles/fabric-dark-lite.css +485 -0
- package/styles/fabric-dark-lite.scss +18 -0
- package/styles/fabric-dark.css +188 -118
- package/styles/fabric-dark.scss +19 -1
- package/styles/fabric-lite.css +485 -0
- package/styles/fabric-lite.scss +18 -0
- package/styles/fabric.css +188 -111
- package/styles/fabric.scss +19 -1
- package/styles/fluent-dark-lite.css +548 -0
- package/styles/fluent-dark-lite.scss +18 -0
- package/styles/fluent-dark.css +195 -116
- package/styles/fluent-dark.scss +19 -1
- package/styles/fluent-lite.css +548 -0
- package/styles/fluent-lite.scss +18 -0
- package/styles/fluent.css +195 -116
- package/styles/fluent.scss +19 -1
- package/styles/fluent2-lite.css +1856 -0
- package/styles/fluent2-lite.scss +18 -0
- package/styles/fluent2.css +1879 -0
- package/styles/fluent2.scss +19 -0
- package/styles/highcontrast-light-lite.css +491 -0
- package/styles/highcontrast-light-lite.scss +18 -0
- package/styles/highcontrast-light.css +185 -103
- package/styles/highcontrast-light.scss +19 -1
- package/styles/highcontrast-lite.css +498 -0
- package/styles/highcontrast-lite.scss +18 -0
- package/styles/highcontrast.css +196 -107
- package/styles/highcontrast.scss +19 -1
- package/styles/material-dark-lite.css +567 -0
- package/styles/material-dark-lite.scss +18 -0
- package/styles/material-dark.css +220 -105
- package/styles/material-dark.scss +19 -1
- package/styles/material-lite.css +591 -0
- package/styles/material-lite.scss +18 -0
- package/styles/material.css +234 -129
- package/styles/material.scss +19 -1
- package/styles/material3-dark-lite.css +1666 -0
- package/styles/material3-dark-lite.scss +18 -0
- package/styles/material3-dark.css +1310 -187
- package/styles/material3-dark.scss +19 -1
- package/styles/material3-lite.css +1668 -0
- package/styles/material3-lite.scss +18 -0
- package/styles/material3.css +1311 -242
- package/styles/material3.scss +19 -1
- package/styles/tailwind-dark-lite.css +518 -0
- package/styles/tailwind-dark-lite.scss +18 -0
- package/styles/tailwind-dark.css +196 -103
- package/styles/tailwind-dark.scss +19 -1
- package/styles/tailwind-lite.css +518 -0
- package/styles/tailwind-lite.scss +18 -0
- package/styles/tailwind.css +196 -103
- package/styles/tailwind.scss +19 -1
- package/styles/tailwind3-lite.css +1697 -0
- package/styles/tailwind3-lite.scss +18 -0
- package/styles/tailwind3.css +1717 -0
- package/styles/tailwind3.scss +19 -0
- package/styles/treegrid/_all.scss +2 -2
- package/styles/treegrid/_bds-definition.scss +49 -28
- package/styles/treegrid/_bigger.scss +66 -0
- package/styles/treegrid/_bootstrap-dark-definition.scss +54 -30
- package/styles/treegrid/_bootstrap-definition.scss +54 -30
- package/styles/treegrid/_bootstrap4-definition.scss +54 -30
- package/styles/treegrid/_bootstrap5-definition.scss +49 -28
- package/styles/treegrid/_bootstrap5.3-definition.scss +49 -0
- package/styles/treegrid/_fabric-dark-definition.scss +54 -30
- package/styles/treegrid/_fabric-definition.scss +54 -30
- package/styles/treegrid/_fluent-definition.scss +50 -29
- package/styles/treegrid/_fluent2-definition.scss +49 -0
- package/styles/treegrid/_fusionnew-definition.scss +49 -28
- package/styles/treegrid/_highcontrast-definition.scss +54 -30
- package/styles/treegrid/_highcontrast-light-definition.scss +54 -30
- package/styles/treegrid/_icons.scss +47 -37
- package/styles/treegrid/_layout.scss +530 -455
- package/styles/treegrid/_material-dark-definition.scss +54 -30
- package/styles/treegrid/_material-definition.scss +54 -30
- package/styles/treegrid/_material3-definition.scss +49 -28
- package/styles/treegrid/_tailwind-definition.scss +49 -28
- package/styles/treegrid/_tailwind3-definition.scss +49 -0
- package/styles/treegrid/_theme.scss +1 -1
- package/styles/treegrid/bds.css +765 -0
- package/styles/treegrid/bds.scss +19 -0
- package/styles/treegrid/bootstrap-dark.css +187 -117
- package/styles/treegrid/bootstrap-dark.scss +1 -0
- package/styles/treegrid/bootstrap.css +190 -121
- package/styles/treegrid/bootstrap.scss +1 -0
- package/styles/treegrid/bootstrap4.css +194 -133
- package/styles/treegrid/bootstrap4.scss +1 -0
- package/styles/treegrid/bootstrap5-dark.css +189 -123
- package/styles/treegrid/bootstrap5-dark.scss +1 -0
- package/styles/treegrid/bootstrap5.3.css +1657 -0
- package/styles/treegrid/bootstrap5.3.scss +19 -0
- package/styles/treegrid/bootstrap5.css +188 -122
- package/styles/treegrid/bootstrap5.scss +1 -0
- package/styles/treegrid/fabric-dark.css +188 -118
- package/styles/treegrid/fabric-dark.scss +1 -0
- package/styles/treegrid/fabric.css +188 -111
- package/styles/treegrid/fabric.scss +1 -0
- package/styles/treegrid/fluent-dark.css +195 -116
- package/styles/treegrid/fluent-dark.scss +1 -0
- package/styles/treegrid/fluent.css +195 -116
- package/styles/treegrid/fluent.scss +1 -0
- package/styles/treegrid/fluent2.css +1879 -0
- package/styles/treegrid/fluent2.scss +19 -0
- package/styles/treegrid/highcontrast-light.css +185 -103
- package/styles/treegrid/highcontrast-light.scss +1 -0
- package/styles/treegrid/highcontrast.css +196 -107
- package/styles/treegrid/highcontrast.scss +1 -0
- package/styles/treegrid/icons/_bds.scss +37 -37
- package/styles/treegrid/icons/_bootstrap-dark.scss +47 -37
- package/styles/treegrid/icons/_bootstrap.scss +47 -37
- package/styles/treegrid/icons/_bootstrap4.scss +47 -37
- package/styles/treegrid/icons/_bootstrap5.3.scss +47 -0
- package/styles/treegrid/icons/_bootstrap5.scss +47 -37
- package/styles/treegrid/icons/_fabric-dark.scss +47 -37
- package/styles/treegrid/icons/_fabric.scss +47 -37
- package/styles/treegrid/icons/_fluent.scss +47 -37
- package/styles/treegrid/icons/_fluent2.scss +47 -0
- package/styles/treegrid/icons/_fusionnew.scss +30 -26
- package/styles/treegrid/icons/_highcontrast-light.scss +47 -37
- package/styles/treegrid/icons/_highcontrast.scss +47 -37
- package/styles/treegrid/icons/_material-dark.scss +47 -37
- package/styles/treegrid/icons/_material.scss +47 -37
- package/styles/treegrid/icons/_material3.scss +47 -37
- package/styles/treegrid/icons/_tailwind-dark.scss +47 -37
- package/styles/treegrid/icons/_tailwind.scss +47 -37
- package/styles/treegrid/icons/_tailwind3.scss +47 -0
- package/styles/treegrid/material-dark.css +220 -105
- package/styles/treegrid/material-dark.scss +1 -0
- package/styles/treegrid/material.css +234 -129
- package/styles/treegrid/material.scss +1 -0
- package/styles/treegrid/material3-dark.css +1310 -187
- package/styles/treegrid/material3-dark.scss +2 -1
- package/styles/treegrid/material3.css +1311 -242
- package/styles/treegrid/material3.scss +2 -1
- package/styles/treegrid/tailwind-dark.css +196 -103
- package/styles/treegrid/tailwind-dark.scss +1 -0
- package/styles/treegrid/tailwind.css +196 -103
- package/styles/treegrid/tailwind.scss +1 -0
- package/styles/treegrid/tailwind3.css +1717 -0
- package/styles/treegrid/tailwind3.scss +19 -0
- package/CHANGELOG.md +0 -250
- package/helpers/e2e/index.d.ts +0 -1
- package/helpers/e2e/index.js +0 -8
- package/helpers/e2e/treegridhelper.d.ts +0 -21
- package/helpers/e2e/treegridhelper.js +0 -83
- package/index.d.ts +0 -4
- package/index.js +0 -4
- package/src/index.d.ts +0 -4
- package/src/treegrid/actions/batch-edit.d.ts +0 -73
- package/src/treegrid/actions/clipboard.d.ts +0 -36
- package/src/treegrid/actions/column-chooser.d.ts +0 -37
- package/src/treegrid/actions/column-menu.d.ts +0 -24
- package/src/treegrid/actions/command-column.d.ts +0 -24
- package/src/treegrid/actions/context-menu.d.ts +0 -42
- package/src/treegrid/actions/crud-actions.d.ts +0 -66
- package/src/treegrid/actions/detail-row.d.ts +0 -39
- package/src/treegrid/actions/edit.d.ts +0 -112
- package/src/treegrid/actions/excel-export.d.ts +0 -59
- package/src/treegrid/actions/filter.d.ts +0 -57
- package/src/treegrid/actions/freeze-column.d.ts +0 -28
- package/src/treegrid/actions/index.d.ts +0 -24
- package/src/treegrid/actions/infinite-scroll.d.ts +0 -96
- package/src/treegrid/actions/logger.d.ts +0 -25
- package/src/treegrid/actions/page.d.ts +0 -67
- package/src/treegrid/actions/pdf-export.d.ts +0 -55
- package/src/treegrid/actions/print.d.ts +0 -37
- package/src/treegrid/actions/reorder.d.ts +0 -36
- package/src/treegrid/actions/resize.d.ts +0 -36
- package/src/treegrid/actions/rowdragdrop.d.ts +0 -113
- package/src/treegrid/actions/selection.d.ts +0 -51
- package/src/treegrid/actions/sort.d.ts +0 -63
- package/src/treegrid/actions/summary.d.ts +0 -47
- package/src/treegrid/actions/toolbar.d.ts +0 -52
- package/src/treegrid/actions/virtual-scroll.d.ts +0 -53
- package/src/treegrid/base/constant.d.ts +0 -160
- package/src/treegrid/base/data.d.ts +0 -90
- package/src/treegrid/base/index.d.ts +0 -11
- package/src/treegrid/base/interface.d.ts +0 -182
- package/src/treegrid/base/treegrid.d.ts +0 -2186
- package/src/treegrid/enum.d.ts +0 -155
- package/src/treegrid/index.d.ts +0 -9
- package/src/treegrid/models/column.d.ts +0 -752
- package/src/treegrid/models/edit-settings.d.ts +0 -90
- package/src/treegrid/models/filter-settings.d.ts +0 -203
- package/src/treegrid/models/index.d.ts +0 -24
- package/src/treegrid/models/infinite-scroll-settings.d.ts +0 -25
- package/src/treegrid/models/loading-indicator.d.ts +0 -19
- package/src/treegrid/models/page-settings.d.ts +0 -60
- package/src/treegrid/models/rowdrop-settings.d.ts +0 -27
- package/src/treegrid/models/search-settings.d.ts +0 -71
- package/src/treegrid/models/selection-settings.d.ts +0 -79
- package/src/treegrid/models/sort-settings.d.ts +0 -40
- package/src/treegrid/models/summary.d.ts +0 -124
- package/src/treegrid/models/textwrap-settings.d.ts +0 -16
- package/src/treegrid/renderer/index.d.ts +0 -5
- package/src/treegrid/renderer/render.d.ts +0 -41
- package/src/treegrid/renderer/virtual-row-model-generator.d.ts +0 -16
- package/src/treegrid/renderer/virtual-tree-content-render.d.ts +0 -75
- package/src/treegrid/utils.d.ts +0 -70
- package/treegrid.d.ts +0 -4
- package/treegrid.js +0 -4
- package/tslint.json +0 -111
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
-
};
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
extendStatics(d, b);
|
|
10
|
+
function __() { this.constructor = d; }
|
|
11
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
+
};
|
|
13
|
+
})();
|
|
14
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
18
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19
|
+
};
|
|
20
20
|
import { Component, addClass, createElement, EventHandler, isNullOrUndefined, extend, merge, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
|
|
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
24
|
import { getNumberFormat } from '@syncfusion/ej2-grids';
|
|
25
25
|
import { Freeze as FreezeColumn } from '@syncfusion/ej2-grids';
|
|
26
|
-
import { RowDropSettings, getUid } from '@syncfusion/ej2-grids';
|
|
26
|
+
import { RowDropSettings, getUid, parentsUntil } from '@syncfusion/ej2-grids';
|
|
27
27
|
import { LoadingIndicator } from '../models/loading-indicator';
|
|
28
28
|
import { FilterSettings } from '../models/filter-settings';
|
|
29
29
|
import { TextWrapSettings } from '../models/textwrap-settings';
|
|
@@ -184,6 +184,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
184
184
|
};
|
|
185
185
|
/**
|
|
186
186
|
* Exports the TreeGrid data to the specified URL using a POST request.
|
|
187
|
+
*
|
|
187
188
|
* @param {string} url - Defines exporting url
|
|
188
189
|
* @returns {void}
|
|
189
190
|
*/
|
|
@@ -214,6 +215,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
214
215
|
};
|
|
215
216
|
/**
|
|
216
217
|
* Sets the header text and other properties for an array of columns based on specified criteria.
|
|
218
|
+
*
|
|
217
219
|
* @param {Column[]} columns - Defines array of columns
|
|
218
220
|
* @param {string[]} include - Defines array of sting
|
|
219
221
|
* @returns {Column[]} returns array of columns
|
|
@@ -300,6 +302,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
300
302
|
* @returns {void}
|
|
301
303
|
*/
|
|
302
304
|
TreeGrid.prototype.sortByColumn = function (columnName, direction, isMultiSort) {
|
|
305
|
+
if (isNullOrUndefined(columnName) && isNullOrUndefined(direction)) {
|
|
306
|
+
var error = 'The provided value for the columnName and direction is undefined. Please ensure the columnName and direction contains string.';
|
|
307
|
+
this.trigger(events.actionFailure, { error: error });
|
|
308
|
+
}
|
|
303
309
|
if (this.sortModule) {
|
|
304
310
|
this.sortModule.sortColumn(columnName, direction, isMultiSort);
|
|
305
311
|
}
|
|
@@ -360,21 +366,27 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
360
366
|
* @returns {void}
|
|
361
367
|
*/
|
|
362
368
|
TreeGrid.prototype.reorderColumns = function (fromFName, toFName) {
|
|
369
|
+
if (isNullOrUndefined(fromFName) && isNullOrUndefined(toFName)) {
|
|
370
|
+
var error = 'The provided value for the fromFName and toFName is undefined. Please ensure the fromFName and toFName contains string.';
|
|
371
|
+
this.trigger(events.actionFailure, { error: error });
|
|
372
|
+
}
|
|
363
373
|
this.grid.reorderColumns(fromFName, toFName);
|
|
364
374
|
};
|
|
365
375
|
TreeGrid.prototype.TreeGridLocale = function () {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
if (!isNullOrUndefined(this.locale)) {
|
|
377
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
378
|
+
var locale = L10n.locale;
|
|
379
|
+
var localeObject = {};
|
|
380
|
+
setValue(this.locale, {}, localeObject);
|
|
381
|
+
var gridLocale = void 0;
|
|
382
|
+
gridLocale = {};
|
|
383
|
+
gridLocale = getObject(this.locale, locale);
|
|
384
|
+
var treeGridLocale = void 0;
|
|
385
|
+
treeGridLocale = {};
|
|
386
|
+
treeGridLocale = getObject(this.getModuleName(), gridLocale);
|
|
387
|
+
setValue('grid', treeGridLocale, getObject(this.locale, localeObject));
|
|
388
|
+
L10n.load(localeObject);
|
|
389
|
+
}
|
|
378
390
|
};
|
|
379
391
|
/**
|
|
380
392
|
* By default, prints all the pages of the TreeGrid and hides the pager.
|
|
@@ -421,45 +433,57 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
421
433
|
}
|
|
422
434
|
break;
|
|
423
435
|
case 'downArrow':
|
|
424
|
-
if (!this.enableVirtualization) {
|
|
436
|
+
if (!this.enableVirtualization && isNullOrUndefined(this.rowTemplate)) {
|
|
425
437
|
target = e.target;
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
if (!isNullOrUndefined(target.querySelectorAll('.e-rowcell'))) {
|
|
439
|
+
target = parentsUntil(target, 'e-rowcell');
|
|
440
|
+
}
|
|
441
|
+
if (!isNullOrUndefined(target)) {
|
|
442
|
+
parentTarget = target.parentElement;
|
|
443
|
+
if (!isNullOrUndefined(parentTarget)) {
|
|
444
|
+
var cellIndex = parentTarget.cellIndex;
|
|
445
|
+
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
446
|
+
parentTarget = target;
|
|
447
|
+
}
|
|
448
|
+
summaryElement = this.findnextRowElement(parentTarget);
|
|
449
|
+
if (summaryElement !== null) {
|
|
450
|
+
var cellIndex_1 = target.cellIndex;
|
|
451
|
+
var row_1 = summaryElement.children[parseInt(cellIndex_1.toString(), 10)];
|
|
452
|
+
addClass([row_1], 'e-focused');
|
|
453
|
+
addClass([row_1], 'e-focus');
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
this.clearSelection();
|
|
457
|
+
}
|
|
441
458
|
}
|
|
442
459
|
}
|
|
443
460
|
}
|
|
444
461
|
break;
|
|
445
462
|
case 'upArrow':
|
|
446
|
-
if (!this.enableVirtualization) {
|
|
463
|
+
if (!this.enableVirtualization && isNullOrUndefined(this.rowTemplate)) {
|
|
447
464
|
target = e.target;
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
465
|
+
if (!isNullOrUndefined(target.querySelectorAll('.e-rowcell'))) {
|
|
466
|
+
target = parentsUntil(target, 'e-rowcell');
|
|
467
|
+
}
|
|
468
|
+
if (!isNullOrUndefined(target)) {
|
|
469
|
+
parentTarget = target.parentElement;
|
|
470
|
+
if (!isNullOrUndefined(parentTarget)) {
|
|
471
|
+
var cellIndex = parentTarget.cellIndex;
|
|
472
|
+
if (this.grid.getColumnByIndex(cellIndex).editType === 'dropdownedit' && isNullOrUndefined(this.grid.getColumnByIndex(cellIndex).edit['obj'])) {
|
|
473
|
+
parentTarget = target;
|
|
474
|
+
}
|
|
475
|
+
summaryElement = this.findPreviousRowElement(parentTarget);
|
|
476
|
+
if (summaryElement !== null) {
|
|
477
|
+
var cellIndex_2 = target.cellIndex;
|
|
478
|
+
if (!isNullOrUndefined(cellIndex_2)) {
|
|
479
|
+
var row_2 = summaryElement.children[parseInt(cellIndex_2.toString(), 10)];
|
|
480
|
+
addClass([row_2], 'e-focused');
|
|
481
|
+
addClass([row_2], 'e-focus');
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
this.clearSelection();
|
|
486
|
+
}
|
|
463
487
|
}
|
|
464
488
|
}
|
|
465
489
|
}
|
|
@@ -653,7 +677,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
653
677
|
name: 'Edit'
|
|
654
678
|
});
|
|
655
679
|
}
|
|
656
|
-
if (this.isCommandColumn(this.columns)) {
|
|
680
|
+
if (!isNullOrUndefined(this.columns) && this.isCommandColumn(this.columns)) {
|
|
657
681
|
modules.push({
|
|
658
682
|
member: 'commandColumn',
|
|
659
683
|
args: [this],
|
|
@@ -786,6 +810,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
786
810
|
var root = 'root';
|
|
787
811
|
this.grid["" + root] = this["" + root] ? this["" + root] : this;
|
|
788
812
|
this.grid.appendTo(gridContainer);
|
|
813
|
+
this.actionFailureHandler();
|
|
789
814
|
var gridContent = this.element.getElementsByClassName('e-gridcontent')[0].childNodes[0];
|
|
790
815
|
gridContent.setAttribute('tabindex', '0');
|
|
791
816
|
var contentTable = this.element.getElementsByClassName('e-content')[0].querySelector('.e-table');
|
|
@@ -808,6 +833,85 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
808
833
|
}
|
|
809
834
|
};
|
|
810
835
|
};
|
|
836
|
+
TreeGrid.prototype.actionFailureHandler = function () {
|
|
837
|
+
var _this = this;
|
|
838
|
+
var failureCases = [];
|
|
839
|
+
var primaryKeyFieldNames = this.getPrimaryKeyFieldNames();
|
|
840
|
+
var RecordsCount = this.flatData.length;
|
|
841
|
+
if ((this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing)
|
|
842
|
+
&& primaryKeyFieldNames.length === 0 && RecordsCount !== 0) {
|
|
843
|
+
failureCases.push('For the CRUD actions, it is necessary to enable Primary Key field for the unique data column.');
|
|
844
|
+
}
|
|
845
|
+
if (this.allowRowDragAndDrop && primaryKeyFieldNames.length === 0 && RecordsCount !== 0) {
|
|
846
|
+
failureCases.push('For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column.');
|
|
847
|
+
}
|
|
848
|
+
if (this.allowPaging && this.enableVirtualization) {
|
|
849
|
+
failureCases.push('Paging is not allowed in virtualization case.');
|
|
850
|
+
}
|
|
851
|
+
if (RecordsCount === 0 && this.columns.length === 0) {
|
|
852
|
+
failureCases.push('Either of the Data source or columns should be given.');
|
|
853
|
+
}
|
|
854
|
+
if (this.frozenColumns > 0 && this.columnModel.filter(function (col) { return col.isFrozen; })) {
|
|
855
|
+
failureCases.push('Use only one attribute for Frozen either IsFrozen or FrozenColumns.');
|
|
856
|
+
}
|
|
857
|
+
if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
|
|
858
|
+
failureCases.push('Virtual scrolling is not compatible with the detail template');
|
|
859
|
+
}
|
|
860
|
+
if (this.stackedHeader && !isNullOrUndefined(this.detailTemplate)) {
|
|
861
|
+
failureCases.push('Virtual scrolling is not compatible with the detail template');
|
|
862
|
+
}
|
|
863
|
+
if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }) || this.frozenRows > 0)
|
|
864
|
+
&& (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
|
|
865
|
+
failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
|
|
866
|
+
}
|
|
867
|
+
if ((this.frozenColumns > 0 || this.columnModel.filter(function (col) { return col.isFrozen; }).length > 0 || this.frozenRows > 0) && this.editSettings.mode === 'Cell') {
|
|
868
|
+
failureCases.push('Frozen rows and columns are not supported with cell editing.');
|
|
869
|
+
}
|
|
870
|
+
if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
|
|
871
|
+
failureCases.push('Selection is not supported in RowTemplate');
|
|
872
|
+
}
|
|
873
|
+
if (this.treeColumnIndex < 0) {
|
|
874
|
+
failureCases.push('For showing tree structure it is must to set the TreeColumnIndex value.');
|
|
875
|
+
}
|
|
876
|
+
if (this.treeColumnIndex >= this.columns.length) {
|
|
877
|
+
failureCases.push('TreeColumnIndex value should not exceed the total column count.');
|
|
878
|
+
}
|
|
879
|
+
if (this.enableVirtualization && (!/[0-9]$/.test(this.columnModel.filter(function (col) { return col.width; }).toString())
|
|
880
|
+
&& !/[px]$/.test(this.columnModel.filter(function (col) { return col.width; }).toString()))
|
|
881
|
+
|| (/[0-9]$/.test(this.height.toString()) && /[px]$/.test(this.height.toString()))) {
|
|
882
|
+
failureCases.push('column width and height should be in pixels');
|
|
883
|
+
}
|
|
884
|
+
if (!isNullOrUndefined(this.childMapping) && !isNullOrUndefined(this.idMapping)) {
|
|
885
|
+
failureCases.push('Both IdMapping and ChildMapping should not be used together for tree grid rendering.');
|
|
886
|
+
}
|
|
887
|
+
if ((!isNullOrUndefined(this.idMapping) && (isNullOrUndefined(this.parentIdMapping))) ||
|
|
888
|
+
((isNullOrUndefined(this.idMapping) && (!isNullOrUndefined(this.parentIdMapping))))) {
|
|
889
|
+
failureCases.push('IdMapping and ParentIdMapping properties should be defined and vice versa.');
|
|
890
|
+
}
|
|
891
|
+
var checkboxColumn = this.columnModel.filter(function (col) { return col.showCheckbox; });
|
|
892
|
+
var treeColumn = this.columns[this.treeColumnIndex];
|
|
893
|
+
if (checkboxColumn.length !== 0) {
|
|
894
|
+
if (checkboxColumn !== treeColumn) {
|
|
895
|
+
failureCases.push('ShowCheckbox column should not be defined other than the tree column.');
|
|
896
|
+
}
|
|
897
|
+
if (checkboxColumn.length > 1) {
|
|
898
|
+
failureCases.push('Only one column can have the ShowCheckbox option enabled.');
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
var alignColumn = this.columnModel.filter(function (col) { return col.textAlign === 'Right' && col.field === _this.columnModel[_this.treeColumnIndex].field; });
|
|
902
|
+
if (alignColumn.length !== 0) {
|
|
903
|
+
failureCases.push('TextAlign right for the tree column is not applicable.');
|
|
904
|
+
}
|
|
905
|
+
if (failureCases.length > 0) {
|
|
906
|
+
var failureEventArgs_1 = {
|
|
907
|
+
error: {}
|
|
908
|
+
};
|
|
909
|
+
failureCases.forEach(function (failureCase, index) {
|
|
910
|
+
failureEventArgs_1.error[parseInt(index.toString(), 10)] = failureCase;
|
|
911
|
+
});
|
|
912
|
+
this.trigger(events.actionFailure, failureEventArgs_1);
|
|
913
|
+
}
|
|
914
|
+
};
|
|
811
915
|
TreeGrid.prototype.refreshToolbarItems = function () {
|
|
812
916
|
var toolbarElement = this.toolbarModule.getToolbar();
|
|
813
917
|
var indentID = this.element.id + '_gridcontrol_indent';
|
|
@@ -1019,7 +1123,9 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
1019
1123
|
}
|
|
1020
1124
|
};
|
|
1021
1125
|
this.grid.printComplete = this.triggerEvents.bind(this);
|
|
1022
|
-
this.grid.actionFailure =
|
|
1126
|
+
this.grid.actionFailure = function (args) {
|
|
1127
|
+
_this.trigger(events.actionFailure, args);
|
|
1128
|
+
};
|
|
1023
1129
|
this.extendedGridDataBoundEvent();
|
|
1024
1130
|
this.extendedGridEvents();
|
|
1025
1131
|
this.extendedGridActionEvents();
|
|
@@ -2132,6 +2238,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2132
2238
|
* @returns {void}
|
|
2133
2239
|
*/
|
|
2134
2240
|
TreeGrid.prototype.deleteRecord = function (fieldName, data) {
|
|
2241
|
+
if ((isNullOrUndefined(fieldName) && (isNullOrUndefined(data)) || (this.getSelectedRecords().length <= 0))) {
|
|
2242
|
+
var error = 'The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number.';
|
|
2243
|
+
this.trigger(events.actionFailure, { error: error });
|
|
2244
|
+
}
|
|
2135
2245
|
if (this.grid.editModule) {
|
|
2136
2246
|
this.grid.editModule.deleteRecord(fieldName, data);
|
|
2137
2247
|
}
|
|
@@ -2200,6 +2310,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2200
2310
|
* @returns {void}
|
|
2201
2311
|
*/
|
|
2202
2312
|
TreeGrid.prototype.deleteRow = function (tr) {
|
|
2313
|
+
if (isNullOrUndefined(tr)) {
|
|
2314
|
+
var error = 'The provided value for the tr is undefined. Please ensure the tr contains HTMLTableRowElement.';
|
|
2315
|
+
this.trigger(events.actionFailure, { error: error });
|
|
2316
|
+
}
|
|
2203
2317
|
if (this.grid.editModule) {
|
|
2204
2318
|
this.grid.editModule.deleteRow(tr);
|
|
2205
2319
|
}
|
|
@@ -2225,9 +2339,11 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2225
2339
|
this.grid.setCellValue(key, field, value);
|
|
2226
2340
|
var rowIndex = this.grid.getRowIndexByPrimaryKey(key);
|
|
2227
2341
|
var record = this.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
|
|
2228
|
-
if (
|
|
2229
|
-
|
|
2342
|
+
if (isNullOrUndefined(record)) {
|
|
2343
|
+
var error = 'The provided value for the record is undefined. Please ensure the record contains ITreeData.';
|
|
2344
|
+
this.trigger(events.actionFailure, { error: error });
|
|
2230
2345
|
}
|
|
2346
|
+
editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);
|
|
2231
2347
|
};
|
|
2232
2348
|
/**
|
|
2233
2349
|
* Updates and refresh the particular row values based on the given primary key value.
|
|
@@ -2278,6 +2394,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2278
2394
|
* @returns {void}
|
|
2279
2395
|
*/
|
|
2280
2396
|
TreeGrid.prototype.goToPage = function (pageNo) {
|
|
2397
|
+
if (isNullOrUndefined(pageNo)) {
|
|
2398
|
+
var error = 'The provided value for the pageNo is undefined. Please ensure the pageNo contains number.';
|
|
2399
|
+
this.trigger(events.actionFailure, { error: error });
|
|
2400
|
+
}
|
|
2281
2401
|
if (this.grid.pagerModule) {
|
|
2282
2402
|
this.grid.pagerModule.goToPage(pageNo);
|
|
2283
2403
|
}
|
|
@@ -2379,6 +2499,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2379
2499
|
* @returns {void}
|
|
2380
2500
|
*/
|
|
2381
2501
|
TreeGrid.prototype.hideColumns = function (keys, hideBy) {
|
|
2502
|
+
if (isNullOrUndefined(keys)) {
|
|
2503
|
+
var error = 'The provided value for the keys is undefined. Please ensure the keys contains string.';
|
|
2504
|
+
this.trigger(events.actionFailure, { error: error });
|
|
2505
|
+
}
|
|
2382
2506
|
this.grid.hideColumns(keys, hideBy);
|
|
2383
2507
|
this.updateColumnModel();
|
|
2384
2508
|
};
|
|
@@ -2476,10 +2600,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2476
2600
|
if (this.grid.columns.length !== this.columnModel.length) {
|
|
2477
2601
|
this.stackedHeader = true;
|
|
2478
2602
|
}
|
|
2479
|
-
if (this.stackedHeader && this.allowResizing) {
|
|
2603
|
+
if (this.stackedHeader && this.allowResizing && !isNullOrUndefined(this.columns)) {
|
|
2480
2604
|
this.updateColumnsWidth(this.columns);
|
|
2481
2605
|
}
|
|
2482
|
-
if (!this.stackedHeader) {
|
|
2606
|
+
if (!this.stackedHeader && !isNullOrUndefined(this.columns)) {
|
|
2483
2607
|
merge(this.columns, this.columnModel);
|
|
2484
2608
|
}
|
|
2485
2609
|
this["" + deepMerge] = undefined; // Workaround for blazor updateModel
|
|
@@ -2488,10 +2612,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2488
2612
|
TreeGrid.prototype.updateColumnsWidth = function (columns) {
|
|
2489
2613
|
var _this = this;
|
|
2490
2614
|
columns.forEach(function (column) {
|
|
2491
|
-
if (column.columns) {
|
|
2615
|
+
if (!isNullOrUndefined(column) && column.columns) {
|
|
2492
2616
|
_this.updateColumnsWidth(column.columns);
|
|
2493
2617
|
}
|
|
2494
|
-
else if (column.field) {
|
|
2618
|
+
else if (!isNullOrUndefined(column) && column.field) {
|
|
2495
2619
|
var currentColumn = _this.grid.getColumnByField(column.field);
|
|
2496
2620
|
if (!isNullOrUndefined(currentColumn)) {
|
|
2497
2621
|
column.width = currentColumn.width;
|
|
@@ -2796,6 +2920,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2796
2920
|
*/
|
|
2797
2921
|
TreeGrid.prototype.expandRow = function (row, record, key, level) {
|
|
2798
2922
|
var _this = this;
|
|
2923
|
+
if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key) && isNullOrUndefined(level)) {
|
|
2924
|
+
var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
|
|
2925
|
+
this.trigger(events.actionFailure, { error: error });
|
|
2926
|
+
}
|
|
2799
2927
|
var parentRec = this.parentData;
|
|
2800
2928
|
if (!this.enableVirtualization) {
|
|
2801
2929
|
parentRec = this.flatData.filter(function (e) {
|
|
@@ -2819,13 +2947,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2819
2947
|
if (expandingArgs.expandAll) {
|
|
2820
2948
|
_this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
2821
2949
|
}
|
|
2822
|
-
_this.expandRows(row, record, parentRec
|
|
2950
|
+
_this.expandRows(row, record, parentRec);
|
|
2823
2951
|
}
|
|
2824
2952
|
});
|
|
2825
2953
|
}
|
|
2826
2954
|
else if ((!this.allowPaging || (pagerValuePresent && this.grid.pagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === 'All')) &&
|
|
2827
2955
|
!this.expandAllPrevent && this.isExpandingEventTriggered) {
|
|
2828
|
-
this.expandRows(row, record, parentRec
|
|
2956
|
+
this.expandRows(row, record, parentRec);
|
|
2829
2957
|
}
|
|
2830
2958
|
this.isExpandingEventTriggered = true;
|
|
2831
2959
|
}
|
|
@@ -2836,13 +2964,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2836
2964
|
if (expandingArgs.expandAll) {
|
|
2837
2965
|
_this.expandCollapseAllChildren(record, 'expand', key, level);
|
|
2838
2966
|
}
|
|
2839
|
-
_this.expandRows(row, record, parentRec
|
|
2967
|
+
_this.expandRows(row, record, parentRec);
|
|
2840
2968
|
}
|
|
2841
2969
|
});
|
|
2842
2970
|
}
|
|
2843
2971
|
};
|
|
2844
2972
|
// Internal method to handle the rows expand
|
|
2845
|
-
TreeGrid.prototype.expandRows = function (row, record, parentRec
|
|
2973
|
+
TreeGrid.prototype.expandRows = function (row, record, parentRec) {
|
|
2846
2974
|
this.expandCollapse('expand', row, record);
|
|
2847
2975
|
var children = 'Children';
|
|
2848
2976
|
if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record["" + children]))) {
|
|
@@ -2913,6 +3041,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2913
3041
|
*/
|
|
2914
3042
|
TreeGrid.prototype.collapseRow = function (row, record, key) {
|
|
2915
3043
|
var _this = this;
|
|
3044
|
+
if (isNullOrUndefined(row) && isNullOrUndefined(record) && isNullOrUndefined(key)) {
|
|
3045
|
+
var error = 'The provided value for the row is undefined. Please ensure the row contains row element.';
|
|
3046
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3047
|
+
}
|
|
2916
3048
|
var parentRec = this.parentData;
|
|
2917
3049
|
if (!this.enableVirtualization) {
|
|
2918
3050
|
parentRec = this.flatData.filter(function (e) {
|
|
@@ -2929,12 +3061,12 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2929
3061
|
if (collapsingArgs.collapseAll) {
|
|
2930
3062
|
_this.expandCollapseAllChildren(record, 'collapse', key);
|
|
2931
3063
|
}
|
|
2932
|
-
_this.collapseRows(row, record, parentRec
|
|
3064
|
+
_this.collapseRows(row, record, parentRec);
|
|
2933
3065
|
}
|
|
2934
3066
|
});
|
|
2935
3067
|
}
|
|
2936
3068
|
else if (!this.allowPaging && !this.collapseAllPrevent && this.isCollapsingEventTriggered) {
|
|
2937
|
-
this.collapseRows(row, record, parentRec
|
|
3069
|
+
this.collapseRows(row, record, parentRec);
|
|
2938
3070
|
}
|
|
2939
3071
|
this.isCollapsingEventTriggered = true;
|
|
2940
3072
|
}
|
|
@@ -2942,13 +3074,13 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2942
3074
|
var args = { data: record, row: row, cancel: false };
|
|
2943
3075
|
this.trigger(events.collapsing, args, function (collapsingArgs) {
|
|
2944
3076
|
if (!collapsingArgs.cancel && !isNullOrUndefined(record)) {
|
|
2945
|
-
_this.collapseRows(row, record, parentRec
|
|
3077
|
+
_this.collapseRows(row, record, parentRec);
|
|
2946
3078
|
}
|
|
2947
3079
|
});
|
|
2948
3080
|
}
|
|
2949
3081
|
};
|
|
2950
3082
|
// Internal method for handling the rows collapse
|
|
2951
|
-
TreeGrid.prototype.collapseRows = function (row, record, parentRec
|
|
3083
|
+
TreeGrid.prototype.collapseRows = function (row, record, parentRec) {
|
|
2952
3084
|
this.expandCollapse('collapse', row, record);
|
|
2953
3085
|
var collapseArgs = { data: record, row: row };
|
|
2954
3086
|
if (!isRemoteData(this)) {
|
|
@@ -2992,6 +3124,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
2992
3124
|
* @returns {void}
|
|
2993
3125
|
*/
|
|
2994
3126
|
TreeGrid.prototype.expandAtLevel = function (level) {
|
|
3127
|
+
if (isNullOrUndefined(level)) {
|
|
3128
|
+
var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
|
|
3129
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3130
|
+
}
|
|
2995
3131
|
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
|
|
2996
3132
|
var rec = this.grid.dataSource.filter(function (e) {
|
|
2997
3133
|
if (e.hasChildRecords && e.level === level) {
|
|
@@ -3014,6 +3150,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3014
3150
|
* @returns {void}
|
|
3015
3151
|
*/
|
|
3016
3152
|
TreeGrid.prototype.expandByKey = function (key) {
|
|
3153
|
+
if (isNullOrUndefined(key)) {
|
|
3154
|
+
var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
|
|
3155
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3156
|
+
}
|
|
3017
3157
|
this.expandCollapseActionByKey(key, 'Expand');
|
|
3018
3158
|
};
|
|
3019
3159
|
TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
|
|
@@ -3071,6 +3211,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3071
3211
|
* @returns {void}
|
|
3072
3212
|
*/
|
|
3073
3213
|
TreeGrid.prototype.collapseAtLevel = function (level) {
|
|
3214
|
+
if (isNullOrUndefined(level)) {
|
|
3215
|
+
var error = 'The provided value for the level is undefined. Please ensure the level contains number.';
|
|
3216
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3217
|
+
}
|
|
3074
3218
|
if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {
|
|
3075
3219
|
var record = this.grid.dataSource.filter(function (e) {
|
|
3076
3220
|
if (e.hasChildRecords && e.level === level) {
|
|
@@ -3093,6 +3237,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3093
3237
|
* @returns {void}
|
|
3094
3238
|
*/
|
|
3095
3239
|
TreeGrid.prototype.collapseByKey = function (key) {
|
|
3240
|
+
if (isNullOrUndefined(key)) {
|
|
3241
|
+
var error = 'The provided value for the key is undefined. Please ensure the key contains number.';
|
|
3242
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3243
|
+
}
|
|
3096
3244
|
this.expandCollapseActionByKey(key, 'Collapse');
|
|
3097
3245
|
};
|
|
3098
3246
|
TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
|
|
@@ -3133,6 +3281,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3133
3281
|
* @returns {void}
|
|
3134
3282
|
*/
|
|
3135
3283
|
TreeGrid.prototype.expandAll = function () {
|
|
3284
|
+
if (this.getCurrentViewRecords().length === 0) {
|
|
3285
|
+
var error = 'The provided value for the datasource is undefined. Please ensure to add the dataSource.';
|
|
3286
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3287
|
+
}
|
|
3136
3288
|
this.isExpandedEventTriggered = false;
|
|
3137
3289
|
this.isExpandingEventTriggered = false;
|
|
3138
3290
|
this.expandCollapseAll('expand');
|
|
@@ -3143,6 +3295,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3143
3295
|
* @returns {void}
|
|
3144
3296
|
*/
|
|
3145
3297
|
TreeGrid.prototype.collapseAll = function () {
|
|
3298
|
+
if (this.getCurrentViewRecords().length === 0) {
|
|
3299
|
+
var error = 'The provided value for the datasource is undefined. Please ensure to add the dataSource.';
|
|
3300
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3301
|
+
}
|
|
3146
3302
|
this.isCollapsedEventTriggered = false;
|
|
3147
3303
|
this.isCollapsingEventTriggered = false;
|
|
3148
3304
|
this.expandCollapseAll('collapse');
|
|
@@ -3702,6 +3858,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3702
3858
|
* @returns {void}
|
|
3703
3859
|
*/
|
|
3704
3860
|
TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {
|
|
3861
|
+
if (isNullOrUndefined(fieldName) && isNullOrUndefined(filterOperator) && isNullOrUndefined(filterValue)) {
|
|
3862
|
+
var error = 'The provided value for the fieldName, filterOperator and filterValue are undefined. Please ensure the fieldName, filterOperator and filterValue.';
|
|
3863
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3864
|
+
}
|
|
3705
3865
|
this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);
|
|
3706
3866
|
};
|
|
3707
3867
|
/**
|
|
@@ -3768,6 +3928,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3768
3928
|
* @returns {void}
|
|
3769
3929
|
*/
|
|
3770
3930
|
TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {
|
|
3931
|
+
if (isNullOrUndefined(data) && isNullOrUndefined(rowIndex) && isNullOrUndefined(colIndex)) {
|
|
3932
|
+
var error = 'The provided value for the index is undefined. Please ensure the index contains number.';
|
|
3933
|
+
this.trigger(events.actionFailure, { error: error });
|
|
3934
|
+
}
|
|
3771
3935
|
this.clipboardModule.paste(data, rowIndex, colIndex);
|
|
3772
3936
|
};
|
|
3773
3937
|
/**
|
|
@@ -3795,7 +3959,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3795
3959
|
* @param {number} columnIndex - Specifies the column index.
|
|
3796
3960
|
* @returns {Element} - Returns movable cell element from the indexes passed
|
|
3797
3961
|
*
|
|
3798
|
-
|
|
3962
|
+
* @deprecated This method is deprecated. Use getCellFromIndex method instead.
|
|
3799
3963
|
*/
|
|
3800
3964
|
TreeGrid.prototype.getMovableCellFromIndex = function (rowIndex, columnIndex) {
|
|
3801
3965
|
return this.grid.getCellFromIndex(rowIndex, columnIndex);
|
|
@@ -3805,7 +3969,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3805
3969
|
*
|
|
3806
3970
|
* @returns {Element[]} - Returns element collection of movable rows
|
|
3807
3971
|
*
|
|
3808
|
-
|
|
3972
|
+
* @deprecated This method is deprecated. Use getDataRows method instead.
|
|
3809
3973
|
*/
|
|
3810
3974
|
TreeGrid.prototype.getMovableDataRows = function () {
|
|
3811
3975
|
return this.grid.getDataRows();
|
|
@@ -3816,7 +3980,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3816
3980
|
* @param {number} index - Specifies the row index.
|
|
3817
3981
|
* @returns {Element} - Returns movable row based on index passed
|
|
3818
3982
|
*
|
|
3819
|
-
|
|
3983
|
+
* @deprecated This method is deprecated. Use getRowByIndex method instead.
|
|
3820
3984
|
*/
|
|
3821
3985
|
TreeGrid.prototype.getMovableRowByIndex = function (index) {
|
|
3822
3986
|
return this.grid.getRowByIndex(index);
|
|
@@ -3825,7 +3989,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3825
3989
|
* Gets the TreeGrid's movable content rows from frozen treegrid.
|
|
3826
3990
|
*
|
|
3827
3991
|
* @returns {Element[]}: Returns movable row element
|
|
3828
|
-
|
|
3992
|
+
* @deprecated This method is deprecated. Use getRows method instead.
|
|
3829
3993
|
*/
|
|
3830
3994
|
TreeGrid.prototype.getMovableRows = function () {
|
|
3831
3995
|
return this.grid.getRows();
|
|
@@ -3836,7 +4000,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3836
4000
|
* @param {number} index - Specifies the row index.
|
|
3837
4001
|
* @returns {Element} returns the element
|
|
3838
4002
|
*
|
|
3839
|
-
|
|
4003
|
+
* @deprecated This method is deprecated. Use getRowByIndex method instead.
|
|
3840
4004
|
*/
|
|
3841
4005
|
TreeGrid.prototype.getFrozenRightRowByIndex = function (index) {
|
|
3842
4006
|
return this.grid.getRowByIndex(index);
|
|
@@ -3846,7 +4010,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3846
4010
|
*
|
|
3847
4011
|
* @returns {Element[]} returns the element
|
|
3848
4012
|
*
|
|
3849
|
-
|
|
4013
|
+
* @deprecated This method is deprecated. Use getRows method instead.
|
|
3850
4014
|
*/
|
|
3851
4015
|
TreeGrid.prototype.getFrozenRightRows = function () {
|
|
3852
4016
|
return this.grid.getRows();
|
|
@@ -3856,7 +4020,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3856
4020
|
*
|
|
3857
4021
|
* @returns {Element[]} Returns the Element
|
|
3858
4022
|
*
|
|
3859
|
-
|
|
4023
|
+
* @deprecated This method is deprecated. Use getDataRows method instead.
|
|
3860
4024
|
*/
|
|
3861
4025
|
TreeGrid.prototype.getFrozenRightDataRows = function () {
|
|
3862
4026
|
return this.grid.getDataRows();
|
|
@@ -3868,7 +4032,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3868
4032
|
* @param {number} columnIndex - Specifies the column index.
|
|
3869
4033
|
* @returns {Element} Returns the Element
|
|
3870
4034
|
*
|
|
3871
|
-
|
|
4035
|
+
* @deprecated This method is deprecated. Use getCellFromIndex method instead.
|
|
3872
4036
|
*/
|
|
3873
4037
|
TreeGrid.prototype.getFrozenRightCellFromIndex = function (rowIndex, columnIndex) {
|
|
3874
4038
|
return this.grid.getCellFromIndex(rowIndex, columnIndex);
|
|
@@ -3879,7 +4043,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3879
4043
|
* @param {number} index - Specifies the column index.
|
|
3880
4044
|
* @returns {Element} Returns the Element
|
|
3881
4045
|
*
|
|
3882
|
-
|
|
4046
|
+
* @deprecated This method is deprecated. Use getColumnHeaderByIndex method instead.
|
|
3883
4047
|
*/
|
|
3884
4048
|
TreeGrid.prototype.getFrozenLeftColumnHeaderByIndex = function (index) {
|
|
3885
4049
|
return this.grid.getColumnHeaderByIndex(index);
|
|
@@ -3890,7 +4054,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3890
4054
|
* @param {number} index - Specifies the column index.
|
|
3891
4055
|
* @returns {Element} Returns the Element
|
|
3892
4056
|
*
|
|
3893
|
-
|
|
4057
|
+
* @deprecated This method is deprecated. Use getColumnHeaderByIndex method instead.
|
|
3894
4058
|
*/
|
|
3895
4059
|
TreeGrid.prototype.getFrozenRightColumnHeaderByIndex = function (index) {
|
|
3896
4060
|
return this.grid.getColumnHeaderByIndex(index);
|
|
@@ -3901,7 +4065,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3901
4065
|
* @param {number} index - Specifies the column index.
|
|
3902
4066
|
* @returns {Element} Returns the Element
|
|
3903
4067
|
*
|
|
3904
|
-
|
|
4068
|
+
* @deprecated This method is deprecated. Use getColumnHeaderByIndex method instead.
|
|
3905
4069
|
*/
|
|
3906
4070
|
TreeGrid.prototype.getMovableColumnHeaderByIndex = function (index) {
|
|
3907
4071
|
return this.grid.getColumnHeaderByIndex(index);
|
|
@@ -3979,7 +4143,7 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
3979
4143
|
* @returns {number} - Returns frozen column count
|
|
3980
4144
|
*/
|
|
3981
4145
|
TreeGrid.prototype.getFrozenColumns = function () {
|
|
3982
|
-
return this.getFrozenCount(this.columns, 0) + this.frozenColumns;
|
|
4146
|
+
return this.getFrozenCount(!isNullOrUndefined(this.columns) && this.columns, 0) + this.frozenColumns;
|
|
3983
4147
|
};
|
|
3984
4148
|
TreeGrid.prototype.getFrozenCount = function (cols, cnt) {
|
|
3985
4149
|
for (var j = 0, len = cols.length; j < len; j++) {
|
|
@@ -4036,6 +4200,10 @@ var TreeGrid = /** @class */ (function (_super) {
|
|
|
4036
4200
|
* @returns {void}
|
|
4037
4201
|
*/
|
|
4038
4202
|
TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {
|
|
4203
|
+
if (isNullOrUndefined(fromIndexes) && isNullOrUndefined(toIndex) && isNullOrUndefined(position)) {
|
|
4204
|
+
var error = 'The provided value for the fromIndexes, toIndex and position is undefined. Please ensure the fromIndexes and toIndex contains number and position contains string.';
|
|
4205
|
+
this.trigger(events.actionFailure, { error: error });
|
|
4206
|
+
}
|
|
4039
4207
|
this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);
|
|
4040
4208
|
};
|
|
4041
4209
|
/**
|