@esfaenza/es-table 11.2.99 → 11.2.101

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.
@@ -2107,18 +2107,25 @@
2107
2107
  this.est.arrayPulsanti = this.utilities.getPagesArray(6, this.est.arraymodePage, this.est.arraymodePages);
2108
2108
  else
2109
2109
  return this.est.View;
2110
+ // Applico eventuali oridnamenti lato Array prima di tirare fuori la pagina selezionata
2111
+ var items = this.est.View;
2112
+ if (this.est)
2113
+ items = this.arrayModeReviewOrderings(items);
2110
2114
  // Poi per tutti i valori dopo compresi fra la pagina - 1 e la pagina
2111
2115
  for (var i = ((this.est.arraymodePage - 1) * this.est.ArraymodeItemsPerPage); i < this.est.arraymodePage * this.est.ArraymodeItemsPerPage; i++) {
2112
- if (i <= this.est.View.length - 1)
2113
- tmpItems.push(this.est.View[i]);
2116
+ if (i <= items.length - 1)
2117
+ tmpItems.push(items[i]);
2114
2118
  }
2115
2119
  return tmpItems;
2116
2120
  };
2117
2121
  /** Se in modalità array applica gli ordinamenti ASC-DESC delle colonne */
2118
- ItemsHandler.prototype.arrayModeReviewOrderings = function () {
2119
- var _this = this;
2122
+ ItemsHandler.prototype.arrayModeReviewOrderings = function (items) {
2123
+ var tmp = items;
2120
2124
  if (this.est.arrayOrders.length > 0)
2121
- this.est.arrayOrders.forEach(function (t) { _this.est.boundSource = _this.est.boundSource.sort(function (a, b) { return (a[t.id] > b[t.id] ? 1 : -1) * (t.order == 'DESC' ? -1 : 1); }); });
2125
+ this.est.arrayOrders.forEach(function (t) {
2126
+ tmp = tmp.sort(function (a, b) { return (a[t.id] > b[t.id] ? 1 : -1) * (t.order == 'DESC' ? -1 : 1); });
2127
+ });
2128
+ return tmp;
2122
2129
  };
2123
2130
  return ItemsHandler;
2124
2131
  }());
@@ -4486,10 +4493,8 @@
4486
4493
  }
4487
4494
  // Prepassaggio per tirare fuori tutte le info utili sugli headers in modo da non ricacolarseli sempre dopo
4488
4495
  var hI = this.columnMetadata_H.evaluateHeadersGroupingInfos(ths);
4489
- if (this.arrayMode) { // In modalità array non ho un backend...
4490
- this.items_H.arrayModeReviewOrderings(); // ... quindi gli ordinamenti li devo fare lato client, e ...
4496
+ if (this.arrayMode) // In modalità array non ho un backend...
4491
4497
  this.rowGrouping_H.arrayModeReviewGroupings(hI.leafs); // ... i raggruppamenti li devo fare lato client
4492
- }
4493
4498
  this.columnMetadata_H.reviewColumnsList(hI.leafs); // Aggiorna la lista delle colonne da mostrare nella dialog per ordinamento ecc
4494
4499
  this.columnMetadata_H.alignColumnsIfLoadedView(view); // Se sto caricando una View da hotpotato (quindi con savedstate = true) riallineo la visibilità delle colonne e il loro ordine.
4495
4500
  this.columnMetadata_H.moveFixedColumnsAtTheBeginning(hI.leafs, tds); // Sposto tutte le cose fixed all'inizio in modo che la creazione di th e td sia più snella (Utilizza le ColumnsList, quindi dev'essere richiamata PIRMA di reviewColumnsList)