@esfaenza/es-table 15.2.28 → 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) {
@@ -4353,6 +4359,9 @@ class EsTableComponent {
4353
4359
  // Se cambia l'oggetto intero significa che ho rimandato la ricerca
4354
4360
  this.setMode('view');
4355
4361
  let firstItemGroupOrNoGrouping = (this.View.requestedgroups?.length || 0) == 0;
4362
+ // Queste sono item source custom. Le valorizzo al default se non esistono
4363
+ if (this.ItemSourceProperty && !this.View[this.ItemSourceProperty])
4364
+ this.View[this.ItemSourceProperty] = [];
4356
4365
  // Se vengo da una ricerca interna mantengo lo stato di selezione precedente (quindi su cambio pagina, cambio ipp, ecc...)
4357
4366
  // se invece l'utente ha fatto una ricerca lui (quindi cambiando filtri), secco le info di selezione
4358
4367
  if (!this.View.selection || (!this.View.internalsearchrequest && firstItemGroupOrNoGrouping) || !this.UseSelectionCache)