@fluxhub/fluxhub-lib 11.0.119 → 11.0.121

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.
@@ -1717,9 +1717,8 @@ FHComboboxComponent.decorators = [
1717
1717
  app.descrizione_valore | translate
1718
1718
  }}</mat-option>
1719
1719
  </mat-select>
1720
- <mat-error *ngIf="error==null">{{ error }}</mat-error>
1721
1720
  </mat-form-field>
1722
-
1721
+ <div *ngIf="error && !(!enabled || hidden || (!is_loaded && myData.length==0))" class="field-error">{{error}}</div>
1723
1722
  <mat-form-field
1724
1723
  [hidden]="enabled || hidden" [class.fh_field_dis]="!enabled"
1725
1724
  appearance="outline"
@@ -12570,8 +12569,8 @@ FHAutoCompleteComponent.decorators = [
12570
12569
  (focusout)="fo_search($event)"
12571
12570
  #searchp
12572
12571
  />
12573
- <mat-error *ngIf="error==null">{{ error }}</mat-error>
12574
12572
  </mat-form-field>
12573
+ <div *ngIf="error && !(!enabled || hidden || (!is_loaded && myData.length==0))" class="field-error">{{error}}</div>
12575
12574
  <mat-autocomplete
12576
12575
  #auto="matAutocomplete"
12577
12576
  (optionSelected)="selectedSearchItem($event)"
@@ -13190,7 +13189,7 @@ FHTextInput.decorators = [
13190
13189
  />
13191
13190
  <mat-hint [hidden]="hint==''">{{hint}}</mat-hint>
13192
13191
  </mat-form-field>
13193
- <div *ngIf="error" class="field-error">{{error}}</div>
13192
+ <div *ngIf="error && !hidden" class="field-error">{{error}}</div>
13194
13193
  `,
13195
13194
  styles: [``]
13196
13195
  },] }
@@ -14397,8 +14396,8 @@ FHNumericFieldComponent.decorators = [
14397
14396
  (keydown)="keyDownFunctioncl($event)"
14398
14397
  />
14399
14398
  <mat-hint [hidden]="hint==''">{{hint}}</mat-hint>
14400
- <mat-error *ngIf="error==null">{{ error }}</mat-error>
14401
14399
  </mat-form-field>
14400
+ <div *ngIf="error && !hidden" class="field-error">{{error}}</div>
14402
14401
  `,
14403
14402
  styles: [`
14404
14403
 
@@ -27831,6 +27830,9 @@ class FHGridComponentN {
27831
27830
  this.clipboard = clipboard;
27832
27831
  this.width_max = '100%';
27833
27832
  this.browser = 'nd';
27833
+ this.pagination = false;
27834
+ this.paginationPageSize = 10;
27835
+ this.paginationAutoPageSize = false;
27834
27836
  this.tooltipShowDelay = 2000;
27835
27837
  this.elimina_label = 'ELIMINA';
27836
27838
  this.export_field_aggiuntivi = '';
@@ -27839,6 +27841,7 @@ class FHGridComponentN {
27839
27841
  this.columnDefs = [];
27840
27842
  this.num_per_pag = 35;
27841
27843
  this.grid_key = 'PRO_H';
27844
+ this.service = 'dogridn';
27842
27845
  this.enabled = true;
27843
27846
  this.show_link = false;
27844
27847
  this.show_help_bar = false;
@@ -27849,6 +27852,7 @@ class FHGridComponentN {
27849
27852
  this.enabled_pag = true;
27850
27853
  this.show_help = true;
27851
27854
  this.show_num_elem = true;
27855
+ this.private_pref = false;
27852
27856
  this.system_dest = 1;
27853
27857
  this.header_h = 35;
27854
27858
  this.selection_mode = 'multiple';
@@ -27863,6 +27867,9 @@ class FHGridComponentN {
27863
27867
  this.label_elementi = ' Elementi';
27864
27868
  this.trova_label = 'TROVA';
27865
27869
  this.mantieni_impostazioni = 'Mantieni Imp.';
27870
+ this.row_height = 25;
27871
+ this.master_detail = false;
27872
+ this.detail_cell_renderer = null;
27866
27873
  this.curr_filter = '';
27867
27874
  this.show_buttons = true;
27868
27875
  this.fill_end = new EventEmitter();
@@ -27874,6 +27881,7 @@ class FHGridComponentN {
27874
27881
  this.custom_export = false;
27875
27882
  this.toolbar_type = 'NONE';
27876
27883
  this.toolbar_custom_commands = [];
27884
+ this.exec_params = [];
27877
27885
  this.command = new EventEmitter();
27878
27886
  this.b_ensure = false;
27879
27887
  this.gf = null;
@@ -28137,6 +28145,7 @@ class FHGridComponentN {
28137
28145
  this.dataSource = {
28138
28146
  //rowCount: ???, - not setting the row count, infinite paging will be used
28139
28147
  getRows: (params) => {
28148
+ // console.log('!!!!params ',params);
28140
28149
  // this code should contact the server for rows. however for the purposes of the demo,
28141
28150
  // the data is generated locally, a timer is used to give the experience of
28142
28151
  // an asynchronous call
@@ -28144,147 +28153,48 @@ class FHGridComponentN {
28144
28153
  //console.log( params.filterModel);// + ' params.filterModel ' +params.filterModel);
28145
28154
  this.m_appService.start();
28146
28155
  let p = { kd: this.tbl_name };
28147
- // p.table = this.tbl_name;
28148
- // p.table_count = this.tbl_name;
28149
- //if (this.count_tbl_name != "") p.table_count = this.count_tbl_name;
28150
- // console.log(params);
28151
- p.num_per_pag = params.endRow - params.startRow;
28152
- // this.gridOptions.paginationPageSize = this.num_per_pag;
28153
- // this.gridOptions.cacheBlockSize = this.num_per_pag;
28154
- // console.log(this.gridOptions.cacheBlockSize );
28155
- // console.log(this.gridOptions.paginationPageSize );
28156
- p.curr_page = Math.round(params.startRow / p.num_per_pag);
28156
+ p.num_per_pag = params.request.endRow - params.request.startRow;
28157
+ p.fix_flt = (this.fix_flt || '');
28158
+ p.curr_page = Math.round(params.request.startRow / p.num_per_pag);
28157
28159
  if (p.curr_page == null)
28158
28160
  p.curr_page = 0;
28159
28161
  if (p.num_per_pag == null)
28160
28162
  p.num_per_pag = 100;
28161
28163
  p.system_dest = this.system_dest;
28164
+ p.exec_params = (this.exec_params || []);
28162
28165
  p.p = JSON.stringify({
28163
- sort_model: params.sortModel,
28164
- filter_model: params.filterModel,
28166
+ sort_model: params.request.sortModel,
28167
+ filter_model: params.request.filterModel,
28165
28168
  free_search: this.ric_libera,
28169
+ fix_flt: (this.fix_flt || '')
28166
28170
  });
28167
- //p.sort_field = this.sort_field;
28168
- /*
28169
- if (params.sortModel != null)
28170
- if (params.sortModel.length > 0) {
28171
- p.sort_field = "";
28172
- for (var i: number = 0; i < params.sortModel.length; i++) {
28173
- if (p.sort_field != "") p.sort_field = p.sort_field + ",";
28174
- if (params.sortModel[i].colId == "autori")
28175
- p.sort_field =
28176
- p.sort_field +
28177
- "case when CHARINDEX('" +
28178
- this.m_appService.user +
28179
- "',autori)>0 then 1 else 0 end" +
28180
- " " +
28181
- params.sortModel[i].sort;
28182
- else
28183
- p.sort_field =
28184
- p.sort_field +
28185
- params.sortModel[i].colId +
28186
- " " +
28187
- params.sortModel[i].sort;
28188
- }
28189
- }
28190
-
28191
-
28192
-
28193
-
28194
- if (this.filters != null) p.filter = this.filters;
28195
-
28196
- if (this.fix_flt != "") {
28197
- if (p.filter != "") p.filter = p.filter + " and ";
28198
- p.filter = p.filter + " (" + this.fix_flt + " )";
28199
- }
28200
-
28201
- if (this.fix_flt_temp != "") {
28202
- if (p.filter != "") p.filter = p.filter + " and ";
28203
- p.filter = p.filter + " (" + this.fix_flt_temp + " )";
28204
- }
28205
-
28206
- // console.log('Filter model');
28207
- //console.log(params.filterModel);
28208
-
28209
- if (params.filterModel != null) {
28210
- // console.log('Filtri');
28211
-
28212
- for (let key in params.filterModel) {
28213
- // console.log(key);
28214
- // if (p.hasOwnProperty(key)) {
28215
- // console.log( params.filterModel[key]);
28216
- let obj_filtro_test = params.filterModel[key];
28217
- console.log(params.filterModel[key], key);
28218
- if (obj_filtro_test.operator == null) {
28219
- if (p.filter == "")
28220
- p.filter += this.calcola_filtro(
28221
- params.filterModel[key],
28222
- "",
28223
- key,
28224
- false
28225
- );
28226
- else
28227
- p.filter += this.calcola_filtro(
28228
- params.filterModel[key],
28229
- "",
28230
- key,
28231
- true
28232
- );
28233
- } else {
28234
- if (p.filter != "") p.filter += " and ";
28235
- p.filter += " (";
28236
- p.filter += this.calcola_filtro(
28237
- params.filterModel[key].condition1,
28238
- "",
28239
- key,
28240
- false
28241
- );
28242
-
28243
- p.filter += " " + obj_filtro_test.operator + " ";
28244
- p.filter += this.calcola_filtro(
28245
- params.filterModel[key].condition2,
28246
- "",
28247
- key,
28248
- false
28249
- );
28250
-
28251
- p.filter += ")";
28252
- }
28253
- // }
28254
- }
28255
- }
28256
-
28257
- (data) => {
28258
- //p.num_per_pag=5000;
28259
- // console.log(this._gridservice);
28260
- this.str_curr_q_p = "";
28261
- if (p.filter != "") this.str_curr_q_p = "where " + p.filter;
28262
- if (p.sort_field != "")
28263
- this.str_curr_q_p = this.str_curr_q_p + " order by " + p.sort_field;
28264
- this.curr_filter = p.filter;*/
28265
- //console.log('params.filterModel ',params.filterModel, JSON.stringify(params.filterModel));
28266
- if ((params.filterModel == null ||
28267
- JSON.stringify(params.filterModel) == '{}') &&
28171
+ if ((params.request.filterModel == null ||
28172
+ JSON.stringify(params.request.filterModel) == '{}') &&
28268
28173
  (this.ric_libera == null || this.ric_libera == ''))
28269
28174
  this.show_pulisci_filtri = false;
28270
28175
  else
28271
28176
  this.show_pulisci_filtri = true;
28272
- // this._gridservice.url='https://web.raytecvision.com/test/api/dogridn';
28273
- this.p_fi = { kd: p.kd, system_dest: p.system_dest, p: p.p };
28177
+ this.p_fi = {
28178
+ kd: p.kd,
28179
+ system_dest: p.system_dest, exec_params: (this.exec_params || []),
28180
+ p: p.p,
28181
+ fix_flt: (this.fix_flt || '')
28182
+ };
28274
28183
  this._gridservice
28275
- .doQuery(p, true, this.m_appService.API_ENDPOINT + 'dogridn')
28184
+ .doQuery(p, true, this.m_appService.API_ENDPOINT + this.service)
28276
28185
  .subscribe((data) => {
28277
28186
  let ok_op = false;
28278
28187
  if (data != null)
28279
28188
  if (data.result_msg == 'OK') {
28280
28189
  ok_op = true;
28281
- // console.log(data.result_data);
28190
+ // console.log(data.result_data, data.count);
28282
28191
  params.successCallback(data.result_data, data.count);
28283
28192
  this.b_init = true;
28284
28193
  this.myData = data.result_data.slice();
28285
28194
  this.num_r = data.count;
28286
28195
  this.m_appService.complete();
28287
28196
  this.fill_end.emit();
28197
+ this.check_width();
28288
28198
  // console.log("end");
28289
28199
  // console.log(localStorage.getItem(this.grid_key+'_POS'));
28290
28200
  localStorage.setItem(this.grid_key + '_POS1', JSON.stringify(p));
@@ -28308,7 +28218,8 @@ class FHGridComponentN {
28308
28218
  let b_mantieni_ck = false;
28309
28219
  if (this.toggle_mantieni != null)
28310
28220
  b_mantieni_ck = this.toggle_mantieni.checked;
28311
- if (this.no_pref && !this.b_init1) {
28221
+ if (this.no_pref && !this.b_init1 &&
28222
+ this.autosize_at_ini) {
28312
28223
  this.autoSizeAll();
28313
28224
  }
28314
28225
  this.b_init1 = true;
@@ -28376,102 +28287,7 @@ class FHGridComponentN {
28376
28287
  icon: '<img src="assets/icons/square-o/xlsx.svg"/>',
28377
28288
  },
28378
28289
  ];
28379
- this.gridOptions = {
28380
- debug: false,
28381
- headerHeight: this.header_h,
28382
- enableRangeSelection: true,
28383
- defaultColDef: { resizable: true, sortable: true, floatingFilter: true },
28384
- allowContextMenuWithControlKey: true,
28385
- rowModelType: 'infinite',
28386
- localeText: {
28387
- // for filter panel
28388
- page: 'pagina',
28389
- more: 'altre',
28390
- to: 'a',
28391
- of: 'di',
28392
- next: 'prossima',
28393
- last: 'ultima',
28394
- first: 'prima',
28395
- previous: 'precedente',
28396
- loadingOoo: 'Caricamento...',
28397
- // for set filter
28398
- selectAll: 'Seleziona Tutto',
28399
- searchOoo: 'Trova...',
28400
- blanks: 'Vuoto',
28401
- // for number filter and text filter
28402
- filterOoo: 'Filtro...',
28403
- applyFilter: 'Applica Filtro...',
28404
- // for number filter
28405
- equals: 'Uguale',
28406
- notEqual: 'Diverso',
28407
- lessThan: 'Minore o Uguale',
28408
- greaterThan: 'Maggiore o Uguale',
28409
- // for text filter
28410
- notContains: 'Non Contiene',
28411
- contains: 'Contiene',
28412
- startsWith: 'Inizia Con',
28413
- endsWith: 'Finisce Con',
28414
- // the header of the default group column
28415
- group: 'Gruppo',
28416
- // tool panel
28417
- columns: 'Colonne',
28418
- rowGroupColumns: 'Colonne Pivot',
28419
- rowGroupColumnsEmptyMessage: 'trascina le colonne per raggrupparle',
28420
- valueColumns: 'Colonne Valore',
28421
- pivotMode: 'Modalità Pivot',
28422
- groups: 'Gruppi',
28423
- values: 'Valori',
28424
- pivots: 'Pivots',
28425
- valueColumnsEmptyMessage: 'trascina le colonne per aggreare',
28426
- pivotColumnsEmptyMessage: 'trascina le colonne per pivot',
28427
- // other
28428
- noRowsToShow: 'nessun dato',
28429
- // enterprise menu
28430
- pinColumn: 'Sposta Colonna',
28431
- valueAggregation: 'Aggregazione',
28432
- autosizeThiscolumn: 'Autosize colonna',
28433
- autosizeAllColumns: 'Autosize tutte le colonne',
28434
- groupBy: 'Raggruppa per',
28435
- ungroupBy: 'Spacca per',
28436
- resetColumns: 'Resetta queste colonna',
28437
- expandAll: 'Espandi',
28438
- collapseAll: 'Chiudi',
28439
- toolPanel: 'Impostazioni',
28440
- // enterprise menu pinning
28441
- pinLeft: 'Sposta <<',
28442
- pinRight: 'Sposta >>',
28443
- noPin: 'Sposta <>',
28444
- // enterprise menu aggregation and status panel
28445
- sum: 'Somma',
28446
- min: 'Minimo',
28447
- max: 'Massimo',
28448
- none: 'Nessuno',
28449
- count: 'Numero',
28450
- average: 'Media',
28451
- // standard menu
28452
- copy: 'Copia',
28453
- ctrlC: 'ctrl n C',
28454
- paste: 'Incolla',
28455
- ctrlV: 'ctrl n C',
28456
- },
28457
- getRowNodeId: function (item) {
28458
- // console.log(item);
28459
- if (item.ID != null)
28460
- return String(item.ID);
28461
- if (item.id != null)
28462
- return String(item.id);
28463
- if (item.uiid != null)
28464
- return item.uiid;
28465
- if (item.codice != null)
28466
- return item.codice;
28467
- if (item.id_doc != null)
28468
- return item.id_doc;
28469
- if (item.notesid != null)
28470
- return item.notesid;
28471
- if (item.ord != null)
28472
- return item.ord;
28473
- },
28474
- };
28290
+ this.gridOptions = {};
28475
28291
  this.last_copy = '';
28476
28292
  this.showGrid = true;
28477
28293
  this.rowData = [];
@@ -28480,6 +28296,7 @@ class FHGridComponentN {
28480
28296
  this.b_init1 = false;
28481
28297
  this.errorMsg = '';
28482
28298
  this.innerWidth = 750;
28299
+ this.init_opt = false;
28483
28300
  this.show_pulisci_filtri = false;
28484
28301
  this.uiid_stampa = '';
28485
28302
  this.xxopx = 0;
@@ -28516,6 +28333,19 @@ class FHGridComponentN {
28516
28333
  return 'other';
28517
28334
  }
28518
28335
  }
28336
+ check_width() {
28337
+ if (!this.autosize_at_ini)
28338
+ return;
28339
+ setTimeout(() => {
28340
+ //get columns size
28341
+ let go = this.gridOptions.columnApi;
28342
+ if (go.getColumnState()[0].width < 24) {
28343
+ setTimeout(() => {
28344
+ this.autoSizeAll();
28345
+ }, 1000);
28346
+ }
28347
+ }, 100);
28348
+ }
28519
28349
  docmd(o) {
28520
28350
  this.command.emit(o);
28521
28351
  }
@@ -28559,7 +28389,6 @@ class FHGridComponentN {
28559
28389
  if (this.curr_config == '-1')
28560
28390
  return;
28561
28391
  localStorage.removeItem(this.grid_key + '_COLS');
28562
- // localStorage.removeItem(this.grid_key + "_SORT");
28563
28392
  localStorage.removeItem(this.grid_key + '_FILTER');
28564
28393
  localStorage.removeItem(this.grid_key + '_CFG_DEFAULT');
28565
28394
  localStorage.removeItem(this.grid_key + '_FILTER_UP');
@@ -28841,7 +28670,7 @@ class FHGridComponentN {
28841
28670
  this.gridOptions.api.setHeaderHeight(this.header_h);
28842
28671
  this.gridOptions.suppressCopyRowsToClipboard = true;
28843
28672
  this.gridOptions.sendToClipboard = (v) => {
28844
- console.log('v ', v);
28673
+ // console.log('v ', v);
28845
28674
  if (this.enable_copy)
28846
28675
  this.gridApi.copySelectedRangeToClipboard();
28847
28676
  {
@@ -28864,6 +28693,107 @@ class FHGridComponentN {
28864
28693
  return 'NA';
28865
28694
  }
28866
28695
  ngAfterViewInit() {
28696
+ this.gridOptions = {
28697
+ debug: false,
28698
+ pagination: this.pagination,
28699
+ paginationPageSize: this.paginationPageSize,
28700
+ headerHeight: this.header_h,
28701
+ paginationAutoPageSize: this.paginationAutoPageSize,
28702
+ rowHeight: this.row_height,
28703
+ enableRangeSelection: true,
28704
+ defaultColDef: { resizable: true, sortable: true, floatingFilter: true },
28705
+ allowContextMenuWithControlKey: true,
28706
+ rowModelType: 'serverSide',
28707
+ localeText: {
28708
+ // for filter panel
28709
+ page: 'pagina',
28710
+ more: 'altre',
28711
+ to: 'a',
28712
+ of: 'di',
28713
+ next: 'prossima',
28714
+ last: 'ultima',
28715
+ first: 'prima',
28716
+ previous: 'precedente',
28717
+ loadingOoo: 'Caricamento...',
28718
+ // for set filter
28719
+ selectAll: 'Seleziona Tutto',
28720
+ searchOoo: 'Trova...',
28721
+ blanks: 'Vuoto',
28722
+ // for number filter and text filter
28723
+ filterOoo: 'Filtro...',
28724
+ applyFilter: 'Applica Filtro...',
28725
+ // for number filter
28726
+ equals: 'Uguale',
28727
+ notEqual: 'Diverso',
28728
+ lessThan: 'Minore o Uguale',
28729
+ greaterThan: 'Maggiore o Uguale',
28730
+ // for text filter
28731
+ notContains: 'Non Contiene',
28732
+ contains: 'Contiene',
28733
+ startsWith: 'Inizia Con',
28734
+ endsWith: 'Finisce Con',
28735
+ // the header of the default group column
28736
+ group: 'Gruppo',
28737
+ // tool panel
28738
+ columns: 'Colonne',
28739
+ rowGroupColumns: 'Colonne Pivot',
28740
+ rowGroupColumnsEmptyMessage: 'trascina le colonne per raggrupparle',
28741
+ valueColumns: 'Colonne Valore',
28742
+ pivotMode: 'Modalità Pivot',
28743
+ groups: 'Gruppi',
28744
+ values: 'Valori',
28745
+ pivots: 'Pivots',
28746
+ valueColumnsEmptyMessage: 'trascina le colonne per aggreare',
28747
+ pivotColumnsEmptyMessage: 'trascina le colonne per pivot',
28748
+ // other
28749
+ noRowsToShow: 'nessun dato',
28750
+ // enterprise menu
28751
+ pinColumn: 'Sposta Colonna',
28752
+ valueAggregation: 'Aggregazione',
28753
+ autosizeThiscolumn: 'Autosize colonna',
28754
+ autosizeAllColumns: 'Autosize tutte le colonne',
28755
+ groupBy: 'Raggruppa per',
28756
+ ungroupBy: 'Spacca per',
28757
+ resetColumns: 'Resetta queste colonna',
28758
+ expandAll: 'Espandi',
28759
+ collapseAll: 'Chiudi',
28760
+ toolPanel: 'Impostazioni',
28761
+ // enterprise menu pinning
28762
+ pinLeft: 'Sposta <<',
28763
+ pinRight: 'Sposta >>',
28764
+ noPin: 'Sposta <>',
28765
+ // enterprise menu aggregation and status panel
28766
+ sum: 'Somma',
28767
+ min: 'Minimo',
28768
+ max: 'Massimo',
28769
+ none: 'Nessuno',
28770
+ count: 'Numero',
28771
+ average: 'Media',
28772
+ // standard menu
28773
+ copy: 'Copia',
28774
+ ctrlC: 'ctrl n C',
28775
+ paste: 'Incolla',
28776
+ ctrlV: 'ctrl n C',
28777
+ },
28778
+ getRowNodeId: function (item) {
28779
+ // console.log(item);
28780
+ if (item.ID != null)
28781
+ return String(item.ID);
28782
+ if (item.id != null)
28783
+ return String(item.id);
28784
+ if (item.uiid != null)
28785
+ return item.uiid;
28786
+ if (item.codice != null)
28787
+ return item.codice;
28788
+ if (item.id_doc != null)
28789
+ return item.id_doc;
28790
+ if (item.notesid != null)
28791
+ return item.notesid;
28792
+ if (item.ord != null)
28793
+ return item.ord;
28794
+ },
28795
+ };
28796
+ this.init_opt = true;
28867
28797
  if (this.grid_key == 'PRO_H')
28868
28798
  this.no_pref = true;
28869
28799
  setTimeout(() => {
@@ -28879,7 +28809,7 @@ class FHGridComponentN {
28879
28809
  okr(event) {
28880
28810
  //console.log(event.column.colDef.field);
28881
28811
  event.data.nome_colonna = event.column.colDef.field;
28882
- this.cell_edited.emit(event);
28812
+ this.cell_edited.emit(event.data);
28883
28813
  }
28884
28814
  help_window() {
28885
28815
  let dialogRef = this.m_dialog.open(win_grid_help, { disableClose: true });
@@ -28908,6 +28838,7 @@ class FHGridComponentN {
28908
28838
  // console.log( this.g_height);
28909
28839
  }
28910
28840
  autoSizeAll() {
28841
+ // console.log("🚀 ~ file: fhgridn.ts:1121 ~ FHGridComponentN ~ autoSizeAll ~ autoSizeAll:")
28911
28842
  if (this.gridOptions == null)
28912
28843
  return;
28913
28844
  if (this.gridOptions.columnApi == null)
@@ -28927,6 +28858,7 @@ class FHGridComponentN {
28927
28858
  this.save_cfg();
28928
28859
  }
28929
28860
  fitSizeAll() {
28861
+ // console.log("🚀 ~ file: fhgridn.ts:1142 ~ FHGridComponentN ~ fitSizeAll ~ fitSizeAll:")
28930
28862
  // console.log("fitSizeAll");
28931
28863
  if (this.gridOptions.api)
28932
28864
  this.gridOptions.api.sizeColumnsToFit();
@@ -28995,7 +28927,7 @@ class FHGridComponentN {
28995
28927
  if (this.gridOptions.api)
28996
28928
  this.gridOptions.api.setFilterModel(null);
28997
28929
  let filtrtm = {}; /*
28998
- this.columnDefs.map((v)=>{
28930
+ this.columnDefs.map((v:any)=>{
28999
28931
  if(v.filter=='agSetColumnFilter'){
29000
28932
  filtrtm[v.field]={type:'set',values:[]}
29001
28933
  }
@@ -29003,141 +28935,6 @@ class FHGridComponentN {
29003
28935
  if (this.gridOptions.api)
29004
28936
  this.gridOptions.api.setFilterModel(filtrtm);
29005
28937
  }
29006
- /*
29007
- public export_excel(format: string = "xlsx") {
29008
- if(this.custom_export){
29009
- this.command.emit({ cmd: "export_excel",v:format });
29010
- return;}
29011
- if (this.num_r > 20000) {
29012
- this._toast.error("Massimo 20000 elementi esportabili");
29013
- return;
29014
- }
29015
- format = "." + format;
29016
-
29017
- this.uiid_stampa = this.uti_s.newGuid();
29018
- this.xxopx = 0;
29019
- let q: string = "";
29020
- this.dialogRef_W = this.m_dialog.open(fh_win_wait, {
29021
- disableClose: true,
29022
- });
29023
- setTimeout(() => {
29024
- this.dialogRef_W.componentInstance.label = "EXPORT IN CORSO";
29025
- });
29026
- let cmds: Array<any> = [];
29027
-
29028
- let str_fields = "";
29029
- let p_col = this.gridOptions.columnApi.getAllDisplayedColumns();
29030
-
29031
- for (let j = 0; j < p_col.length; j++) {
29032
- if (str_fields != "") str_fields += ",";
29033
- if (p_col[j].getColDef().headerName == null)
29034
- str_fields += "[" + p_col[j].getColDef().field + "]";
29035
- else if (p_col[j].getColDef().headerName == "")
29036
- str_fields += "[" + p_col[j].getColDef().field + "]";
29037
- else
29038
- str_fields +=
29039
- "[" +
29040
- p_col[j].getColDef().field +
29041
- "] [" +
29042
- p_col[j].getColDef().headerName.split('[').join('').split(']').join('') +
29043
- "]";
29044
- }
29045
- if (this.fields.indexOf("DISTINCT") != -1)
29046
- str_fields = "DISTINCT " + str_fields;
29047
- cmds.push(
29048
- this.officeService.operation(
29049
- "GB_XLS_APRI",
29050
- "tpl_report.xlsx",
29051
- "" + this.uiid_stampa + ".xlsx",
29052
- this.xxopx++
29053
- )
29054
- );
29055
- let opx:string='GB_CREA_TABELLA_FROM_DB';
29056
- if(this.system_dest==2)opx='GB_CREA_TABELLA_FROM_DB1';
29057
- if(this.export_field_aggiuntivi=='')
29058
- cmds.push(
29059
- this.officeService.operation(
29060
- opx,
29061
- "select " +
29062
- str_fields+
29063
- " from " +
29064
- this.tbl_name +
29065
- " " +
29066
- this.str_curr_q_p,
29067
- "3",
29068
- this.xxopx++
29069
- )
29070
- );
29071
- else
29072
- cmds.push(
29073
- this.officeService.operation(
29074
- opx,
29075
- "select " +
29076
- str_fields +','+this.export_field_aggiuntivi+
29077
- " from " +
29078
- this.tbl_name +
29079
- " " +
29080
- this.str_curr_q_p,
29081
- "3",
29082
- this.xxopx++
29083
- )
29084
- );
29085
- cmds.push(
29086
- this.officeService.operation(
29087
- "GB_XLS_SAVE",
29088
- this.m_appService.LOCAL_PATH +
29089
- "grid_reports\\" +
29090
- this.uiid_stampa +
29091
- "_" +
29092
- this.m_appService.user +
29093
- format,
29094
- "",
29095
- this.xxopx++
29096
- )
29097
- );
29098
-
29099
- this.officeService
29100
- .runCommands(this.uiid_stampa, cmds, this.dialogRef_W,false)
29101
- .subscribe((data) => {
29102
- this.check_end(format);
29103
- });
29104
- }
29105
- check_end(format:any){
29106
-
29107
-
29108
- let p: FSInput = new FSInput();
29109
- p.p1 =
29110
- this.m_appService.LOCAL_PATH +
29111
- "grid_reports\\" +
29112
- this.uiid_stampa +
29113
- "_" +
29114
- this.m_appService.user +
29115
- format;
29116
- p.command = "check_file";
29117
- this._fileService.doQuery(p).subscribe((data) => {
29118
- if (data != null)
29119
- if (data.msg == "N") {
29120
- setTimeout(() => {
29121
- this.check_end(format);
29122
- },5000);
29123
- } else {
29124
- setTimeout(() => {
29125
- this.dialogRef_W.componentInstance.update_progess(100);
29126
- });
29127
- window.open(
29128
- this.m_appService.COMPANY_SITE_ROOT +
29129
- "/grid_reports/" +
29130
- this.uiid_stampa +
29131
- "_" +
29132
- this.m_appService.user +
29133
- format
29134
- );
29135
- }
29136
- });
29137
-
29138
- }
29139
-
29140
- */
29141
28938
  print() {
29142
28939
  if (this.custom_export)
29143
28940
  this.command.emit({ cmd: 'print_pdf' });
@@ -29268,6 +29065,7 @@ class FHGridComponentN {
29268
29065
  this.autoSizeAll();
29269
29066
  }
29270
29067
  res_columns(forza = false) {
29068
+ console.log("🚀 ~ file: fhgridn.ts:1370 ~ FHGridComponentN ~ res_columns ~ res_columns:", forza);
29271
29069
  if (this.columnDefs == null) {
29272
29070
  setTimeout(() => {
29273
29071
  this.res_columns(forza);
@@ -29290,9 +29088,11 @@ class FHGridComponentN {
29290
29088
  return;
29291
29089
  }
29292
29090
  if (localStorage.getItem(this.grid_key + '_COLS') != null &&
29293
- (b_mantieni_ck || forza))
29091
+ (b_mantieni_ck || forza)) {
29092
+ // console.log('qqqqq1111');
29294
29093
  if (localStorage.getItem(this.grid_key + '_COLS') != '') {
29295
29094
  b_rip = true;
29095
+ // console.log('qqqqq2222');
29296
29096
  try {
29297
29097
  let a = JSON.parse((localStorage.getItem(this.grid_key + '_COLS') || '[]'));
29298
29098
  let annulla = true;
@@ -29300,16 +29100,24 @@ class FHGridComponentN {
29300
29100
  if (!a[i].hide)
29301
29101
  annulla = false;
29302
29102
  }
29103
+ // console.log('qqqqq3333 ',annulla);
29303
29104
  if (annulla)
29304
29105
  localStorage.getItem(this.grid_key + '_COLS');
29305
- else if (localStorage.getItem(this.grid_key + '_COLS'))
29306
- if (this.gridOptions.columnApi)
29307
- this.gridOptions.columnApi.setColumnState((JSON.parse(localStorage.getItem(this.grid_key + '_COLS') || '{}')));
29106
+ else {
29107
+ // console.log('qqqqq4444');
29108
+ if (localStorage.getItem(this.grid_key + '_COLS'))
29109
+ if (this.gridOptions.columnApi) {
29110
+ // console.log('qqqqq5555',JSON.parse(localStorage.getItem(this.grid_key + '_COLS')||'{}'));
29111
+ let colState = { state: JSON.parse(localStorage.getItem(this.grid_key + '_COLS') || '{}') };
29112
+ this.gridOptions.columnApi.applyColumnState(colState);
29113
+ }
29114
+ }
29308
29115
  }
29309
29116
  catch (eer) {
29310
29117
  console.log(eer);
29311
29118
  }
29312
29119
  }
29120
+ }
29313
29121
  /* try {
29314
29122
  this.gridOptions.api.setSortModel(null);
29315
29123
  } catch (eer) {
@@ -29364,7 +29172,7 @@ class FHGridComponentN {
29364
29172
  this.ref_dt();
29365
29173
  }, 500);
29366
29174
  else
29367
- this.gridOptions.api.setDatasource(this.dataSource);
29175
+ this.gridOptions.api.setServerSideDatasource(this.dataSource);
29368
29176
  }
29369
29177
  }
29370
29178
  updateRow() {
@@ -29374,12 +29182,19 @@ class FHGridComponentN {
29374
29182
  // console.log('onModelUpdated');
29375
29183
  // this.calculateRowCount();
29376
29184
  }
29185
+ doSearch(s) {
29186
+ this.ric_libera = s;
29187
+ this.free_search();
29188
+ }
29377
29189
  onReady(event) {
29378
29190
  // console.log(this.header_h);
29379
29191
  this.gridApi = event.api;
29380
29192
  this.setHeaderHeight(this.header_h);
29381
29193
  if (this.gf != null && this.show_buttons && !this.pref_hidden) {
29382
- this.gf.sql = 'SELECT_CFG_GRID';
29194
+ if (!this.private_pref)
29195
+ this.gf.sql = 'SELECT_CFG_GRID';
29196
+ else
29197
+ this.gf.sql = 'SELECT_CFG_GRID_BY_USER';
29383
29198
  this.gf.types = ['string'];
29384
29199
  this.gf.values = [this.grid_key];
29385
29200
  this.gf.fillCombo();
@@ -29495,7 +29310,7 @@ class FHGridComponentN {
29495
29310
  }
29496
29311
  });
29497
29312
  if (ss_r != '') {
29498
- console.log('ADDO '), ss_r;
29313
+ // console.log('ADDO '), ss_r;
29499
29314
  if (ss != '')
29500
29315
  ss += ' and ';
29501
29316
  ss += '(' + ss_r + ')';
@@ -29505,6 +29320,8 @@ class FHGridComponentN {
29505
29320
  this.doFill_Temp(ss, true);
29506
29321
  }
29507
29322
  onCellClicked(event) {
29323
+ if (!this.b_init)
29324
+ return;
29508
29325
  // console.log(event.rowIndex + ' ' + event.colDef.field);
29509
29326
  this.cell_clicked.emit(event);
29510
29327
  // console.log(this.myModalNormal);
@@ -29523,7 +29340,7 @@ class FHGridComponentN {
29523
29340
  onCellFocused(event) {
29524
29341
  //console.log('onCellFocused: (' + event.rowIndex + ',' + event.colIndex + ')');
29525
29342
  }
29526
- onSelectionChanged() {
29343
+ onSelectionChanged(event) {
29527
29344
  // console.log('selectionChanged');
29528
29345
  }
29529
29346
  onBeforeFilterChanged() {
@@ -29531,6 +29348,8 @@ class FHGridComponentN {
29531
29348
  }
29532
29349
  oncolumnEverythingChanged(event) {
29533
29350
  // console.log('oncolumnEverythingChanged');
29351
+ if (!this.b_init)
29352
+ return;
29534
29353
  if (this.b_init) {
29535
29354
  // console.log('salvo f: '+JSON.stringify(this.gridOptions.columnApi.getColumnState()));
29536
29355
  if (this.gridOptions.columnApi)
@@ -29538,6 +29357,8 @@ class FHGridComponentN {
29538
29357
  }
29539
29358
  }
29540
29359
  onFilterModified() {
29360
+ if (!this.b_init)
29361
+ return;
29541
29362
  if (this.no_pref)
29542
29363
  return;
29543
29364
  setTimeout(() => {
@@ -29572,6 +29393,8 @@ class FHGridComponentN {
29572
29393
  // console.log('onVirtualRowRemoved: ' + event.rowIndex);
29573
29394
  }
29574
29395
  onRowClicked($event) {
29396
+ if (!this.b_init)
29397
+ return;
29575
29398
  //console.log('onRowClicked: ' );
29576
29399
  var selectedInGrid;
29577
29400
  if (this.gridOptions.api)
@@ -29596,6 +29419,8 @@ class FHGridComponentN {
29596
29419
  }
29597
29420
  }
29598
29421
  onRowDClicked($event) {
29422
+ if (!this.b_init)
29423
+ return;
29599
29424
  //console.log('onRowClicked: ' );
29600
29425
  //console.log(event);
29601
29426
  this.dclicked.emit($event.data);
@@ -29612,6 +29437,8 @@ class FHGridComponentN {
29612
29437
  // here we use one generic event to handle all the column type events.
29613
29438
  // the method just prints the event name
29614
29439
  onColumnEvent($event) {
29440
+ if (!this.b_init)
29441
+ return;
29615
29442
  this.columndclicked.emit($event);
29616
29443
  // console.log('onColumnEvent: ' + $event);
29617
29444
  // localStorage.setItem(this.grid_key+'_COLUMN',JSON.stringify(this.gridOptions.api.getColumnDef()));
@@ -29666,6 +29493,9 @@ FHGridComponentN.ctorParameters = () => [
29666
29493
  { type: Clipboard }
29667
29494
  ];
29668
29495
  FHGridComponentN.propDecorators = {
29496
+ pagination: [{ type: Input }],
29497
+ paginationPageSize: [{ type: Input }],
29498
+ paginationAutoPageSize: [{ type: Input }],
29669
29499
  tooltipShowDelay: [{ type: Input }],
29670
29500
  elimina_label: [{ type: Input }],
29671
29501
  export_field_aggiuntivi: [{ type: Input }],
@@ -29674,6 +29504,7 @@ FHGridComponentN.propDecorators = {
29674
29504
  columnDefs: [{ type: Input }],
29675
29505
  num_per_pag: [{ type: Input }],
29676
29506
  grid_key: [{ type: Input }],
29507
+ service: [{ type: Input }],
29677
29508
  enabled: [{ type: Input }],
29678
29509
  show_link: [{ type: Input }],
29679
29510
  show_help_bar: [{ type: Input }],
@@ -29684,6 +29515,8 @@ FHGridComponentN.propDecorators = {
29684
29515
  enabled_pag: [{ type: Input }],
29685
29516
  show_help: [{ type: Input }],
29686
29517
  show_num_elem: [{ type: Input }],
29518
+ private_pref: [{ type: Input }],
29519
+ icons: [{ type: Input }],
29687
29520
  system_dest: [{ type: Input }],
29688
29521
  header_h: [{ type: Input }],
29689
29522
  selection_mode: [{ type: Input }],
@@ -29698,6 +29531,9 @@ FHGridComponentN.propDecorators = {
29698
29531
  label_elementi: [{ type: Input }],
29699
29532
  trova_label: [{ type: Input }],
29700
29533
  mantieni_impostazioni: [{ type: Input }],
29534
+ row_height: [{ type: Input }],
29535
+ master_detail: [{ type: Input }],
29536
+ detail_cell_renderer: [{ type: Input }],
29701
29537
  show_buttons: [{ type: Input }],
29702
29538
  fill_end: [{ type: Output }],
29703
29539
  cell_edited: [{ type: Output }],
@@ -29709,6 +29545,7 @@ FHGridComponentN.propDecorators = {
29709
29545
  toolbar_type: [{ type: Input }],
29710
29546
  toolbar_wkfapp: [{ type: Input }],
29711
29547
  toolbar_custom_commands: [{ type: Input }],
29548
+ exec_params: [{ type: Input }],
29712
29549
  command: [{ type: Output }],
29713
29550
  gf: [{ type: ViewChild, args: ['gf',] }],
29714
29551
  toggle_mantieni: [{ type: ViewChild, args: ['toggle_mantieni',] }],