@syncfusion/ej2-treegrid 20.3.58 → 20.3.60

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.
@@ -1239,9 +1239,9 @@ class Selection {
1239
1239
  if (recordIndex > -1) {
1240
1240
  if (!isNullOrUndefined(checkbox)) {
1241
1241
  checkbox.classList.add(checkBoxclass);
1242
- let chkstate = checkState == 'check' ? 'checked' : checkState == 'uncheck' ? 'unchecked' : 'mixed';
1243
- tr.querySelector('.e-treecheckselect').setAttribute("aria-checked", checkState == 'check' ? 'true' : checkState == 'uncheck' ? 'false' : 'mixed');
1244
- tr.querySelector('.e-frame').setAttribute("title", "checkbox" + chkstate);
1242
+ const chkstate = checkState === 'check' ? 'checked' : checkState === 'uncheck' ? 'unchecked' : 'mixed';
1243
+ tr.querySelector('.e-treecheckselect').setAttribute('aria-checked', checkState === 'check' ? 'true' : checkState === 'uncheck' ? 'false' : 'mixed');
1244
+ tr.querySelector('.e-frame').setAttribute('title', 'checkbox' + chkstate);
1245
1245
  }
1246
1246
  }
1247
1247
  }
@@ -1568,7 +1568,7 @@ class Render {
1568
1568
  }
1569
1569
  if (iconRequired) {
1570
1570
  addClass([args.cell], 'e-treerowcell');
1571
- args.cell.setAttribute("aria-expanded", data.expanded ? "true" : "false");
1571
+ args.cell.setAttribute('aria-expanded', data.expanded ? 'true' : 'false');
1572
1572
  const expandIcon = createElement('span', { className: 'e-icons' });
1573
1573
  let expand;
1574
1574
  if (this.parent.initialRender) {
@@ -3749,7 +3749,8 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
3749
3749
  }
3750
3750
  IsExpandCollapseClicked(args) {
3751
3751
  if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')
3752
- || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {
3752
+ || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))
3753
+ && (!isNullOrUndefined(args.data) && args.data['hasChildRecords'])) {
3753
3754
  args.cancel = true;
3754
3755
  return;
3755
3756
  }
@@ -4407,7 +4408,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4407
4408
  }
4408
4409
  let treeGridColumn;
4409
4410
  let gridColumn;
4410
- index = index === 0 ? -1 : index;
4411
+ if (this.columnModel.length == 0) {
4412
+ index = index === 0 ? -1 : index;
4413
+ }
4411
4414
  const gridColumnCollection = [];
4412
4415
  for (let i = 0; i < column.length; i++) {
4413
4416
  index = index + 1;
@@ -5885,7 +5888,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5885
5888
  }
5886
5889
  removeClass([targetEle], 'e-treegridexpand');
5887
5890
  }
5888
- row.querySelectorAll('.e-treerowcell')[0].setAttribute("aria-expanded", action == 'expand' ? 'true' : 'false');
5891
+ row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
5889
5892
  const detailrows = gridRows.filter((r) => r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1)));
5890
5893
  if (isRemoteData(this) && !isOffline(this)) {
5891
5894
  this.remoteExpand(action, row, record);
@@ -6067,10 +6070,23 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6067
6070
  if (freeze) {
6068
6071
  freezeRightRows = this.getFrozenRightRows().filter((r) => r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1)));
6069
6072
  }
6073
+ let gridRowsObject = this.grid.getRowsObject();
6074
+ if (gridRowsObject[record.index].visible !== false) {
6075
+ gridRowsObject[record.index].visible = true;
6076
+ }
6077
+ const detailrows = gridRows.filter((r) => r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1)));
6070
6078
  for (let i = 0; i < rows.length; i++) {
6071
6079
  if (!isNullOrUndefined(rows[i])) {
6072
6080
  rows[i].style.display = displayAction;
6073
6081
  }
6082
+ if (!isNullOrUndefined(rows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6083
+ gridRowsObject[rows[i].rowIndex].visible = displayAction != 'none' ? true : false;
6084
+ if ("parentItem" in record) {
6085
+ if (gridRows[record.parentItem.index].getElementsByClassName('e-treegridcollapse').length) {
6086
+ gridRowsObject[record.index].visible = false;
6087
+ }
6088
+ }
6089
+ }
6074
6090
  if (!isNullOrUndefined(movableRows)) {
6075
6091
  movableRows[i].style.display = displayAction;
6076
6092
  }
@@ -6086,6 +6102,15 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6086
6102
  }
6087
6103
  }
6088
6104
  }
6105
+ for (let i = 0; i < detailrows.length; i++) {
6106
+ if (!isNullOrUndefined(detailrows[i]) && !this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6107
+ gridRowsObject[detailrows[i].rowIndex].visible = displayAction != 'none' ? true : false;
6108
+ detailrows[i].style.display = displayAction;
6109
+ }
6110
+ }
6111
+ if (!this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {
6112
+ this.grid.notify('refresh-Expand-and-Collapse', { rows: this.grid.getRowsObject() });
6113
+ }
6089
6114
  }
6090
6115
  updateAltRow(rows) {
6091
6116
  if (this.enableAltRow && !this.rowTemplate) {
@@ -12407,7 +12432,7 @@ class TreeInterSectionObserver extends InterSectionObserver {
12407
12432
  this.lastPos = null;
12408
12433
  }
12409
12434
  virtualScrollHandlers(callback, onEnterCallback, instance) {
12410
- const delay = Browser.info.name === 'chrome' ? 200 : 100;
12435
+ //const delay: number = Browser.info.name === 'chrome' ? 200 : 100;
12411
12436
  const options = 'options';
12412
12437
  const movableEle = 'movableEle';
12413
12438
  const element = 'element';