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