@fluxhub/fluxhub-lib 19.0.161 → 19.0.163

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.
@@ -9471,15 +9471,12 @@ class FHGridComponent {
9471
9471
  }
9472
9472
  dataSource = {
9473
9473
  getRows: (params) => {
9474
- console.log('🔵 getRows chiamato - startRow:', params.request.startRow, 'endRow:', params.request.endRow);
9475
9474
  this.num_r = -1;
9476
9475
  this.m_appService.start();
9477
9476
  let p = { kd: this.grid_config_key };
9478
9477
  p.num_per_pag = params.request.endRow - params.request.startRow;
9479
9478
  p.fix_flt = this.fix_flt || '';
9480
- const rawPage = params.request.startRow / p.num_per_pag;
9481
- p.curr_page = Math.round(rawPage);
9482
- console.log('🔵 Calcolato curr_page:', p.curr_page, '(raw:', rawPage, ') - num_per_pag:', p.num_per_pag, '- startRow:', params.request.startRow);
9479
+ p.curr_page = Math.round(params.request.startRow / p.num_per_pag);
9483
9480
  if (p.curr_page == null)
9484
9481
  p.curr_page = 0;
9485
9482
  if (p.num_per_pag == null)
@@ -9517,25 +9514,14 @@ class FHGridComponent {
9517
9514
  if (data.result_msg == 'OK') {
9518
9515
  ok_op = true;
9519
9516
  this.rowData = data.result_data;
9520
- console.log('✅ params.success chiamato - rowCount:', data.count, 'rowData.length:', data.result_data.length);
9521
9517
  params.success({ rowData: data.result_data, rowCount: data.count });
9522
- // Salva lo stato PRIMA di modificarlo
9523
- const isFirstDataLoad = !this.b_init;
9524
9518
  this.b_init = true;
9525
9519
  this.myData = data.result_data.slice();
9526
9520
  this.num_r = data.count;
9527
- console.log('🔄 SKIPPO cdr.detectChanges() per test');
9528
- // this.cdr.detectChanges();
9529
- console.log('🔄 cdr.detectChanges() skippato');
9521
+ this.cdr.detectChanges();
9530
9522
  this.m_appService.complete();
9531
- console.log('📢 SKIPPO fill_end.emit() per test');
9532
- // this.fill_end.emit();
9533
- console.log('📢 fill_end.emit() skippato');
9534
- // check_width() può causare resize che triggera nuovi caricamenti - chiamalo solo al primo caricamento
9535
- if (isFirstDataLoad) {
9536
- console.log('📏 Chiamando check_width() (SOLO PRIMA VOLTA)');
9537
- this.check_width();
9538
- }
9523
+ this.fill_end.emit();
9524
+ this.check_width();
9539
9525
  localStorage.setItem(this.grid_customer_preference_key + '_POS1', JSON.stringify(p));
9540
9526
  if (localStorage.getItem(this.grid_customer_preference_key + '_POS2') != null)
9541
9527
  if (this.gridOptions != null)
@@ -9557,17 +9543,10 @@ class FHGridComponent {
9557
9543
  if (this.toggle_mantieni != null)
9558
9544
  b_mantieni_ck = this.toggle_mantieni.checked;
9559
9545
  if (this.no_pref && !this.b_init1 && this.autosize_at_ini) {
9560
- console.log('📐 Chiamando set_init_size()');
9561
9546
  this.set_init_size();
9562
9547
  }
9563
- // Salva lo stato PRIMA di modificarlo per evitare ExpressionChangedAfterItHasBeenCheckedError
9564
- const isFirstLoad = !this.b_init1;
9565
9548
  this.b_init1 = true;
9566
- // Chiama ensure_visible() SOLO al primo caricamento per evitare loop infiniti
9567
- if (isFirstLoad) {
9568
- console.log('👁️ Chiamando ensure_visible() (SOLO PRIMA VOLTA)');
9569
- this.ensure_visible();
9570
- }
9549
+ this.ensure_visible();
9571
9550
  if (localStorage.getItem(this.grid_customer_preference_key + '_COLS') == null &&
9572
9551
  this.autosize_at_ini)
9573
9552
  setTimeout(() => {
@@ -9802,32 +9781,59 @@ class FHGridComponent {
9802
9781
  ctrlV: this._trs.instant('ctrl & V'),
9803
9782
  },
9804
9783
  getRowId: (itemg) => {
9805
- if (itemg == null)
9784
+ if (itemg == null) {
9785
+ console.warn('🆔 getRowId: itemg NULL - generando GUID!');
9806
9786
  return this.uti_s.newGuid();
9807
- if (itemg.data == null)
9787
+ }
9788
+ if (itemg.data == null) {
9789
+ console.warn('🆔 getRowId: data NULL - generando GUID!');
9808
9790
  return this.uti_s.newGuid();
9791
+ }
9809
9792
  let item = itemg.data;
9810
9793
  let rowId;
9811
- if (item.customKeyField != null)
9794
+ let source;
9795
+ if (item.customKeyField != null) {
9812
9796
  rowId = [item.customKeyField];
9813
- else if (item.ID != null)
9797
+ source = 'customKeyField';
9798
+ }
9799
+ else if (item.ID != null) {
9814
9800
  rowId = String(item.ID);
9815
- else if (item.id != null)
9801
+ source = 'ID';
9802
+ }
9803
+ else if (item.id != null) {
9816
9804
  rowId = String(item.id);
9817
- else if (item.uiid != null)
9805
+ source = 'id';
9806
+ }
9807
+ else if (item.uiid != null) {
9818
9808
  rowId = item.uiid;
9819
- else if (item.codice != null)
9809
+ source = 'uiid';
9810
+ }
9811
+ else if (item.codice != null) {
9820
9812
  rowId = item.codice;
9821
- else if (item.id_gruppo != null)
9813
+ source = 'codice';
9814
+ }
9815
+ else if (item.id_gruppo != null) {
9822
9816
  rowId = item.id_gruppo;
9823
- else if (item.id_doc != null)
9817
+ source = 'id_gruppo';
9818
+ }
9819
+ else if (item.id_doc != null) {
9824
9820
  rowId = item.id_doc;
9825
- else if (item.notesid != null)
9821
+ source = 'id_doc';
9822
+ }
9823
+ else if (item.notesid != null) {
9826
9824
  rowId = item.notesid;
9827
- else if (item.ord != null)
9825
+ source = 'notesid';
9826
+ }
9827
+ else if (item.ord != null) {
9828
9828
  rowId = item.ord;
9829
- else
9829
+ source = 'ord';
9830
+ }
9831
+ else {
9832
+ console.warn('🆔 getRowId: NESSUN CAMPO ID TROVATO - generando GUID! Campi disponibili:', Object.keys(item));
9830
9833
  rowId = this.uti_s.newGuid();
9834
+ source = 'GUID_GENERATO';
9835
+ }
9836
+ console.log('🆔 getRowId:', rowId, '(source:', source + ')');
9831
9837
  return rowId;
9832
9838
  }
9833
9839
  };
@@ -10152,7 +10158,6 @@ class FHGridComponent {
10152
10158
  // return sortData(sortModel, filterData(filterModel, allOfTheData))
10153
10159
  }
10154
10160
  ref_dt() {
10155
- console.log('🔴 ref_dt() chiamato - Stack trace:', new Error().stack?.split('\n').slice(1, 4).join('\n'));
10156
10161
  if (this.gridOptions == null)
10157
10162
  setTimeout(() => {
10158
10163
  this.ref_dt();
@@ -10162,10 +10167,8 @@ class FHGridComponent {
10162
10167
  setTimeout(() => {
10163
10168
  this.ref_dt();
10164
10169
  }, 500);
10165
- else {
10166
- console.log('🔴 ref_dt() - setGridOption(serverSideDatasource) - RESETTA TUTTO');
10170
+ else
10167
10171
  this.gridApi.setGridOption('serverSideDatasource', this.dataSource);
10168
- }
10169
10172
  }
10170
10173
  }
10171
10174
  updateRow() {
@@ -10437,7 +10440,6 @@ class FHGridComponent {
10437
10440
  }, 10);
10438
10441
  }
10439
10442
  Refresh() {
10440
- console.log('🟠 Refresh() chiamato');
10441
10443
  this.ref_dt();
10442
10444
  }
10443
10445
  RefreshOnlyMemory() {