jquery.dgtable 0.6.2 → 0.6.4

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jquery.dgtable 0.6.2
2
+ * jquery.dgtable 0.6.4
3
3
  * git://github.com/danielgindi/jquery.dgtable.git
4
4
  */
5
5
  'use strict';
@@ -1791,9 +1791,9 @@ const hasInsertAdjacentElement = Element.prototype.insertAdjacentElement !== und
1791
1791
  function insertBefore(el, before, parent) {
1792
1792
  if (!before)
1793
1793
  parent.appendChild(el);else
1794
- if (hasInsertAdjacentElement === true)
1795
- before.insertAdjacentElement('beforebegin', el);else
1796
- parent.insertBefore(el, before);
1794
+ if (hasInsertAdjacentElement === false || el instanceof DocumentFragment)
1795
+ parent.insertBefore(el, before);else
1796
+ before.insertAdjacentElement('beforebegin', el);
1797
1797
  }
1798
1798
 
1799
1799
  /**
@@ -2346,7 +2346,7 @@ class VirtualListHelper {
2346
2346
  }
2347
2347
 
2348
2348
  // Find the element to insert before
2349
- let before = list.childNodes[0];
2349
+ let before = itemParent.childNodes[0];
2350
2350
 
2351
2351
  /** @type DocumentFragment|null */
2352
2352
  let fragment = null;
@@ -3578,7 +3578,7 @@ DGTable.prototype._setupHovers = function () {
3578
3578
  };
3579
3579
  };
3580
3580
 
3581
- DGTable.prototype._setupVirtualTable = function () {
3581
+ DGTable.prototype._setupVirtualTable = function () {var _p$filteredRows;
3582
3582
  const that = this,p = that.p,o = that.o;
3583
3583
 
3584
3584
  const tableClassName = o.tableClassName,
@@ -3603,7 +3603,7 @@ DGTable.prototype._setupVirtualTable = function () {
3603
3603
  list: p.table,
3604
3604
  itemsParent: p.tbody,
3605
3605
  autoVirtualWrapperWidth: false,
3606
- virtual: true,
3606
+ virtual: o.virtualTable,
3607
3607
  buffer: o.rowsBufferSize,
3608
3608
  estimatedItemHeight: o.estimatedRowHeight ? o.estimatedRowHeight : p.virtualRowHeight || 40,
3609
3609
  itemElementCreatorFn: () => {
@@ -3660,7 +3660,7 @@ DGTable.prototype._setupVirtualTable = function () {
3660
3660
  }
3661
3661
  });
3662
3662
 
3663
- p.virtualListHelper.setCount(p.rows.length);
3663
+ p.virtualListHelper.setCount(((_p$filteredRows = p.filteredRows) !== null && _p$filteredRows !== void 0 ? _p$filteredRows : p.rows).length);
3664
3664
 
3665
3665
  p.notifyRendererOfColumnsConfig();
3666
3666
  };
@@ -3949,7 +3949,7 @@ DGTable.prototype.render = function () {
3949
3949
  return this;
3950
3950
  }
3951
3951
 
3952
- if (p.tableSkeletonNeedsRendering === true) {
3952
+ if (p.tableSkeletonNeedsRendering === true) {var _p$filteredRows2;
3953
3953
  p.tableSkeletonNeedsRendering = false;
3954
3954
 
3955
3955
  if (o.width === DGTable.Width.AUTO) {
@@ -3965,7 +3965,7 @@ DGTable.prototype.render = function () {
3965
3965
  tableWidthChanged(true, false) // Take this chance to calculate required column widths
3966
3966
  ._renderSkeletonHeaderCells();
3967
3967
 
3968
- p.virtualListHelper.invalidate();
3968
+ p.virtualListHelper.setCount(((_p$filteredRows2 = p.filteredRows) !== null && _p$filteredRows2 !== void 0 ? _p$filteredRows2 : p.rows).length);
3969
3969
 
3970
3970
  this._updateLastCellWidthFromScrollbar(true);
3971
3971