@esfaenza/es-table 15.2.29 → 15.2.30

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.
@@ -1112,7 +1112,8 @@ class ColumnMetadataHandler {
1112
1112
  let orderedLeafs = [];
1113
1113
  for (let i = 0; i < this.est.OrderDirectives.length; i++) {
1114
1114
  let leaf = infos.thsCache[this.est.OrderDirectives[i]];
1115
- if (leaf.thVisible && leaf.thIf && !leaf.thPinned)
1115
+ // Solo se la leaf è presente. Potrebbero esserci ordinamenti su colonne sparite
1116
+ if (leaf && leaf.thVisible && leaf.thIf && !leaf.thPinned)
1116
1117
  orderedLeafs.push(leaf);
1117
1118
  }
1118
1119
  /****** STEP 3: Creo l'array group con tutti i riferimenti del caso ******/
@@ -1215,6 +1216,11 @@ class ColumnMetadataHandler {
1215
1216
  generateDefaultOrder(ths, view) {
1216
1217
  if (ths.length == 0)
1217
1218
  return;
1219
+ //*********************************************** Fix ordinamenti per colonne sparite ****************************** */
1220
+ // Considero solo gli ordinamenti per colonne effettivamente presenti all'interno della tabella
1221
+ if (this.est.viewMode)
1222
+ view.column_ordering = view.column_ordering.filter(ord => ths.find(t => t.th == ord));
1223
+ //*********************************************** Fix ordinamenti per colonne sparite ****************************** */
1218
1224
  let orderings = this.est.viewMode ? view.column_ordering : this.est.arrayColumnOrdering;
1219
1225
  // Genero ordinamento di default da 0 fino a dove deve arrivare. Situazione attuale senza hotpotato
1220
1226
  if (!orderings || orderings.length == 0) {