@syncfusion/ej2-treegrid 19.4.52 → 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 +12 -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 +41 -11
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +41 -11
- 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 +8 -8
- package/src/treegrid/actions/crud-actions.js +5 -0
- package/src/treegrid/actions/rowdragdrop.js +11 -0
- package/src/treegrid/actions/toolbar.js +17 -7
- package/src/treegrid/base/treegrid.js +8 -4
|
@@ -2893,6 +2893,11 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
|
|
|
2893
2893
|
column: control.grid.getColumns()[control.treeColumnIndex],
|
|
2894
2894
|
requestType: action
|
|
2895
2895
|
});
|
|
2896
|
+
if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {
|
|
2897
|
+
control.renderModule.RowModifier({
|
|
2898
|
+
data: record, row: row
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2896
2901
|
}
|
|
2897
2902
|
}
|
|
2898
2903
|
}
|
|
@@ -3613,6 +3618,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3613
3618
|
};
|
|
3614
3619
|
this.grid.rowDeselected = (args) => {
|
|
3615
3620
|
this.selectedRowIndex = this.grid.selectedRowIndex;
|
|
3621
|
+
if (!isNullOrUndefined(args.data)) {
|
|
3622
|
+
this.notify(rowDeselected, args);
|
|
3623
|
+
}
|
|
3616
3624
|
this.trigger(rowDeselected, args);
|
|
3617
3625
|
};
|
|
3618
3626
|
this.grid.resizeStop = (args) => {
|
|
@@ -3927,7 +3935,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3927
3935
|
this.grid.query = this.grid.query instanceof Query ? this.grid.query : new Query();
|
|
3928
3936
|
}
|
|
3929
3937
|
}
|
|
3930
|
-
if (this.action !== '
|
|
3938
|
+
if (this.action !== 'indenting' && this.action !== 'outdenting') {
|
|
3931
3939
|
const callBackPromise = new Deferred();
|
|
3932
3940
|
this.trigger(actionBegin, args, (actionArgs) => {
|
|
3933
3941
|
if (!actionArgs.cancel) {
|
|
@@ -3956,7 +3964,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
3956
3964
|
if (args.requestType === 'save' && this.aggregates.map((ag) => ag.showChildSummary === true).length) {
|
|
3957
3965
|
this.grid.refresh();
|
|
3958
3966
|
}
|
|
3959
|
-
if (this.action === '
|
|
3967
|
+
if (this.action === 'indenting' || this.action === 'outdenting') {
|
|
3968
|
+
this.action = this.action === 'indenting' ? 'indented' : 'outdented';
|
|
3960
3969
|
const actionArgs = {
|
|
3961
3970
|
requestType: this.action,
|
|
3962
3971
|
data: this.selectedRecords,
|
|
@@ -4166,7 +4175,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4166
4175
|
case ToolbarItem.RowIndent:
|
|
4167
4176
|
tooltipText = this.l10n.getConstant('RowIndent');
|
|
4168
4177
|
items.push({
|
|
4169
|
-
text: tooltipText, tooltipText: tooltipText,
|
|
4178
|
+
text: tooltipText, tooltipText: tooltipText, disabled: true,
|
|
4170
4179
|
prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'
|
|
4171
4180
|
});
|
|
4172
4181
|
break;
|
|
@@ -4174,7 +4183,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
|
|
|
4174
4183
|
case ToolbarItem.RowOutdent:
|
|
4175
4184
|
tooltipText = this.l10n.getConstant('RowOutdent');
|
|
4176
4185
|
items.push({
|
|
4177
|
-
text: tooltipText, tooltipText: tooltipText,
|
|
4186
|
+
text: tooltipText, tooltipText: tooltipText, disabled: true,
|
|
4178
4187
|
prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'
|
|
4179
4188
|
});
|
|
4180
4189
|
break;
|
|
@@ -6795,6 +6804,7 @@ class RowDD$1 {
|
|
|
6795
6804
|
*/
|
|
6796
6805
|
reorderRows(fromIndexes, toIndex, position) {
|
|
6797
6806
|
const tObj = this.parent;
|
|
6807
|
+
const action = 'action';
|
|
6798
6808
|
if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
|
|
6799
6809
|
if (position === 'above') {
|
|
6800
6810
|
this.dropPosition = 'topSegment';
|
|
@@ -6821,6 +6831,11 @@ class RowDD$1 {
|
|
|
6821
6831
|
if (tObj.isLocalData) {
|
|
6822
6832
|
tObj.flatData = this.orderToIndex(tObj.flatData);
|
|
6823
6833
|
}
|
|
6834
|
+
if (this.parent[action] === 'outdenting') {
|
|
6835
|
+
if (!isNullOrUndefined(data[0].parentItem)) {
|
|
6836
|
+
data[0].level = data[0].parentItem.level + 1;
|
|
6837
|
+
}
|
|
6838
|
+
}
|
|
6824
6839
|
this.parent.grid.refresh();
|
|
6825
6840
|
if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {
|
|
6826
6841
|
const index = this.parent.treeColumnIndex + 1;
|
|
@@ -6841,6 +6856,11 @@ class RowDD$1 {
|
|
|
6841
6856
|
column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
|
|
6842
6857
|
requestType: 'rowDragAndDrop'
|
|
6843
6858
|
});
|
|
6859
|
+
if (this.parent[action] === 'indenting' || this.parent[action] === 'outdenting') {
|
|
6860
|
+
this.parent.renderModule.RowModifier({
|
|
6861
|
+
data: totalRecord[i], row: rows[i]
|
|
6862
|
+
});
|
|
6863
|
+
}
|
|
6844
6864
|
}
|
|
6845
6865
|
}
|
|
6846
6866
|
}
|
|
@@ -8799,6 +8819,7 @@ class Toolbar$1 {
|
|
|
8799
8819
|
*/
|
|
8800
8820
|
addEventListener() {
|
|
8801
8821
|
this.parent.on(rowSelected, this.refreshToolbar, this);
|
|
8822
|
+
this.parent.on(rowDeselected, this.refreshToolbar, this);
|
|
8802
8823
|
this.parent.on(toolbarClick, this.toolbarClickHandler, this);
|
|
8803
8824
|
}
|
|
8804
8825
|
/**
|
|
@@ -8810,6 +8831,7 @@ class Toolbar$1 {
|
|
|
8810
8831
|
return;
|
|
8811
8832
|
}
|
|
8812
8833
|
this.parent.off(rowSelected, this.refreshToolbar);
|
|
8834
|
+
this.parent.off(rowDeselected, this.refreshToolbar);
|
|
8813
8835
|
this.parent.off(toolbarClick, this.toolbarClickHandler);
|
|
8814
8836
|
}
|
|
8815
8837
|
refreshToolbar(args) {
|
|
@@ -8817,7 +8839,7 @@ class Toolbar$1 {
|
|
|
8817
8839
|
if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {
|
|
8818
8840
|
this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);
|
|
8819
8841
|
}
|
|
8820
|
-
else {
|
|
8842
|
+
else if (args['name'] !== "rowDeselected") {
|
|
8821
8843
|
if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {
|
|
8822
8844
|
if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&
|
|
8823
8845
|
(tObj.getCurrentViewRecords()[args.row.rowIndex].level >
|
|
@@ -8839,6 +8861,14 @@ class Toolbar$1 {
|
|
|
8839
8861
|
}
|
|
8840
8862
|
}
|
|
8841
8863
|
}
|
|
8864
|
+
if (args['name'] === "rowDeselected") {
|
|
8865
|
+
if (this.parent.toolbar['includes']('Indent')) {
|
|
8866
|
+
this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
|
|
8867
|
+
}
|
|
8868
|
+
if (this.parent.toolbar['includes']('Outdent')) {
|
|
8869
|
+
this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
|
|
8870
|
+
}
|
|
8871
|
+
}
|
|
8842
8872
|
if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {
|
|
8843
8873
|
this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
|
|
8844
8874
|
}
|
|
@@ -8870,8 +8900,8 @@ class Toolbar$1 {
|
|
|
8870
8900
|
else {
|
|
8871
8901
|
dropIndex = tObj.getSelectedRowIndexes()[0] - 1;
|
|
8872
8902
|
}
|
|
8873
|
-
this.parent[action] = '
|
|
8874
|
-
this.eventTrigger('
|
|
8903
|
+
this.parent[action] = 'indenting';
|
|
8904
|
+
this.eventTrigger('indenting', dropIndex);
|
|
8875
8905
|
}
|
|
8876
8906
|
if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {
|
|
8877
8907
|
let dropIndex;
|
|
@@ -8881,8 +8911,8 @@ class Toolbar$1 {
|
|
|
8881
8911
|
dropIndex = i;
|
|
8882
8912
|
}
|
|
8883
8913
|
}
|
|
8884
|
-
this.parent[action] = '
|
|
8885
|
-
this.eventTrigger('
|
|
8914
|
+
this.parent[action] = 'outdenting';
|
|
8915
|
+
this.eventTrigger('outdenting', dropIndex);
|
|
8886
8916
|
}
|
|
8887
8917
|
}
|
|
8888
8918
|
eventTrigger(action, dropIndex) {
|
|
@@ -8898,10 +8928,10 @@ class Toolbar$1 {
|
|
|
8898
8928
|
};
|
|
8899
8929
|
this.parent.trigger(actionBegin, actionArgs, (actionArgs) => {
|
|
8900
8930
|
if (!actionArgs.cancel) {
|
|
8901
|
-
if (actionArgs.requestType === '
|
|
8931
|
+
if (actionArgs.requestType === 'indenting') {
|
|
8902
8932
|
this.parent.reorderRows([this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');
|
|
8903
8933
|
}
|
|
8904
|
-
else if (actionArgs.requestType === '
|
|
8934
|
+
else if (actionArgs.requestType === 'outdenting') {
|
|
8905
8935
|
this.parent.reorderRows([this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');
|
|
8906
8936
|
}
|
|
8907
8937
|
}
|