@syncfusion/ej2-treegrid 23.2.6 → 24.1.41

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.
@@ -534,7 +534,7 @@ class TreeClipboard extends Clipboard {
534
534
  this.treeCopyContent += '\n';
535
535
  }
536
536
  if (!rows[selectedIndexes[parseInt(i.toString(), 10)]].classList.contains('e-summaryrow')) {
537
- const cells = [].slice.call(rows[selectedIndexes[parseInt(i.toString(), 10)]].querySelectorAll('.e-rowcell:not(.e-hide)'));
537
+ const cells = [].slice.call(rows[selectedIndexes[parseInt(i.toString(), 10)]].querySelectorAll('.e-rowcell'));
538
538
  const uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)][`${uniqueID}`];
539
539
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
540
540
  if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {
@@ -596,7 +596,7 @@ class TreeClipboard extends Clipboard {
596
596
  if (!isNullOrUndefined(currentRecords[parseInt(selectedIndex.toString(), 10)][`${parentItem}`]) &&
597
597
  currentRecords[parseInt(j.toString(), 10)][`${uniqueID}`] === currentRecords[parseInt(selectedIndex.toString(), 10)][`${parentItem}`][`${uniqueID}`]) {
598
598
  selectedIndex = j;
599
- const cells = [].slice.call(rows[parseInt(selectedIndex.toString(), 10)].querySelectorAll('.e-rowcell:not(.e-hide)'));
599
+ const cells = [].slice.call(rows[parseInt(selectedIndex.toString(), 10)].querySelectorAll('.e-rowcell'));
600
600
  const uniqueid = currentRecords[parseInt(j.toString(), 10)][`${uniqueID}`];
601
601
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
602
602
  this[`${getCopyData}`](cells, false, '\t', withHeader);
@@ -651,7 +651,7 @@ class TreeClipboard extends Clipboard {
651
651
  for (let j = 0; j < currentRecords.length; j++) {
652
652
  if (!isNullOrUndefined(childData[parseInt(i.toString(), 10)][`${uniqueID}`]) && currentRecords[parseInt(j.toString(), 10)][`${uniqueID}`] === childData[parseInt(i.toString(), 10)][`${uniqueID}`]) {
653
653
  if ((!isNullOrUndefined(rows[parseInt(j.toString(), 10)])) && !rows[parseInt(j.toString(), 10)].classList.contains('e-summaryrow')) {
654
- const cells = [].slice.call(rows[parseInt(j.toString(), 10)].querySelectorAll('.e-rowcell:not(.e-hide)'));
654
+ const cells = [].slice.call(rows[parseInt(j.toString(), 10)].querySelectorAll('.e-rowcell'));
655
655
  const uniqueid = currentRecords[parseInt(j.toString(), 10)][`${uniqueID}`];
656
656
  if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {
657
657
  this[`${getCopyData}`](cells, false, '\t', withHeader);
@@ -1566,7 +1566,18 @@ class Render {
1566
1566
  this.parent[`${lastRowBorder}`](args.row, true);
1567
1567
  }
1568
1568
  }
1569
- this.parent.trigger(rowDataBound, args);
1569
+ if (this.parent.isReact) {
1570
+ const renderReactTemplates = 'renderReactTemplates';
1571
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
1572
+ const thisRef = this;
1573
+ // tslint:disable-next-line:typedef
1574
+ thisRef.parent[`${renderReactTemplates}`](function () {
1575
+ thisRef.parent.trigger(rowDataBound, args);
1576
+ });
1577
+ }
1578
+ else {
1579
+ this.parent.trigger(rowDataBound, args);
1580
+ }
1570
1581
  }
1571
1582
  /**
1572
1583
  * cell renderer for tree column index cell
@@ -1727,7 +1738,10 @@ class Render {
1727
1738
  }
1728
1739
  }
1729
1740
  }
1730
- if (isNullOrUndefined(this.parent.rowTemplate)) {
1741
+ this.parent['args'] = args;
1742
+ if ((isNullOrUndefined(this.parent.rowTemplate) && !(this.parent.isReact))
1743
+ || ((this.parent.isReact) &&
1744
+ !args.column['template'])) {
1731
1745
  this.parent.trigger(queryCellInfo, args);
1732
1746
  }
1733
1747
  }
@@ -1764,7 +1778,12 @@ class Render {
1764
1778
  this.parent.grid[`${portals}`] = this.parent[`${portals}`];
1765
1779
  }
1766
1780
  this.parent.notify('renderReactTemplate', this.parent[`${portals}`]);
1767
- this.parent[`${renderReactTemplates}`]();
1781
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
1782
+ const thisRef = this;
1783
+ // tslint:disable-next-line:typedef
1784
+ thisRef.parent[`${renderReactTemplates}`](function () {
1785
+ thisRef.parent.trigger(queryCellInfo, args);
1786
+ });
1768
1787
  }
1769
1788
  else {
1770
1789
  const str = 'isStringTemplate';
@@ -1817,12 +1836,13 @@ class Render {
1817
1836
  columnTemplateResult(args) {
1818
1837
  this.templateResult = args.template;
1819
1838
  }
1820
- reactTemplateRender(args) {
1839
+ // eslint-disable-next-line
1840
+ reactTemplateRender(args, callBack) {
1821
1841
  const renderReactTemplates = 'renderReactTemplates';
1822
1842
  const portals = 'portals';
1823
1843
  this.parent[`${portals}`] = args;
1824
1844
  this.parent.notify('renderReactTemplate', this.parent[`${portals}`]);
1825
- this.parent[`${renderReactTemplates}`]();
1845
+ this.parent[`${renderReactTemplates}`](callBack);
1826
1846
  }
1827
1847
  destroy() {
1828
1848
  this.parent.grid.off('template-result', this.columnTemplateResult);
@@ -6762,11 +6782,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6762
6782
  treeColumnRowTemplate() {
6763
6783
  let rows = this.getContentTable().rows;
6764
6784
  rows = [].slice.call(rows);
6785
+ const rowsObject = this.grid.getRowsObject();
6765
6786
  for (let i = 0; i < rows.length; i++) {
6766
6787
  const rcell = this.grid.getContentTable().rows[parseInt(i.toString(), 10)]
6767
6788
  .cells[this.treeColumnIndex];
6768
6789
  const row = rows[parseInt(i.toString(), 10)];
6769
- const rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].data;
6790
+ const rowData = rowsObject.length !== 0 ? rowsObject[parseInt(i.toString(), 10)].data : new Object();
6770
6791
  const arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };
6771
6792
  this.renderModule.cellRender(arg);
6772
6793
  }
@@ -9624,7 +9645,7 @@ class ExcelExport$1 {
9624
9645
  if (!this.isLocal()) {
9625
9646
  this.parent.flatData = [];
9626
9647
  }
9627
- if (property && property.dataSource) {
9648
+ if (property && property.dataSource && this.isLocal()) {
9628
9649
  const flatsData = this.parent.flatData;
9629
9650
  const dataSrc = property.dataSource instanceof DataManager ? property.dataSource.dataSource.json : property.dataSource;
9630
9651
  this.parent.dataModule.convertToFlatData(dataSrc);
@@ -9633,6 +9654,7 @@ class ExcelExport$1 {
9633
9654
  }
9634
9655
  property = isNullOrUndefined(property) ? Object() : property;
9635
9656
  property.dataSource = new DataManager({ json: dtSrc });
9657
+ property.query = args['query'];
9636
9658
  return property;
9637
9659
  }
9638
9660
  /**
@@ -9816,7 +9838,7 @@ class PdfExport$1 {
9816
9838
  if (!isLocal) {
9817
9839
  this.parent.flatData = [];
9818
9840
  }
9819
- if (prop && prop.dataSource) {
9841
+ if (prop && prop.dataSource && isLocal) {
9820
9842
  const flatDatas = this.parent.flatData;
9821
9843
  const dataSrc = prop.dataSource instanceof DataManager ? prop.dataSource.dataSource.json : prop.dataSource;
9822
9844
  this.parent.dataModule.convertToFlatData(dataSrc);
@@ -9825,6 +9847,7 @@ class PdfExport$1 {
9825
9847
  }
9826
9848
  prop = isNullOrUndefined(prop) ? {} : prop;
9827
9849
  prop.dataSource = new DataManager({ json: dtSrc });
9850
+ prop.query = args['query'];
9828
9851
  return prop;
9829
9852
  }
9830
9853
  /**
@@ -10393,7 +10416,12 @@ class Aggregate$1 {
10393
10416
  if (this.parent.isReact) {
10394
10417
  const renderReactTemplates = 'renderReactTemplates';
10395
10418
  tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);
10396
- this.parent[`${renderReactTemplates}`]();
10419
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
10420
+ const thisRef = this;
10421
+ // tslint:disable-next-line:typedef
10422
+ thisRef.parent[`${renderReactTemplates}`](function () {
10423
+ thisRef.parent.trigger(queryCellInfo, thisRef.parent['args']);
10424
+ });
10397
10425
  }
10398
10426
  else {
10399
10427
  appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));
@@ -13278,7 +13306,8 @@ class VirtualScroll$1 {
13278
13306
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
13279
13307
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13280
13308
  }
13281
- if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt'])) {
13309
+ if ((requestType === 'save' && pageingDetails.actionArgs.index >= (counts.count - this.parent.grid.pageSettings.pageSize)) || (requestType === 'refresh' && this.parent['isGantt'] && this.parent['isAddedFromGantt']
13310
+ && this.parent.grid.pageSettings.currentPage === this.parent.grid.contentModule['maxPage'])) {
13282
13311
  startIndex = counts.startIndex + (counts.count - counts.endIndex);
13283
13312
  endIndex = counts.count;
13284
13313
  this.parent['isAddedFromGantt'] = false;