@fluxhub/fluxhub-lib 11.0.120 → 11.0.122

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.
@@ -17407,6 +17407,9 @@
17407
17407
  this.clipboard = clipboard;
17408
17408
  this.width_max = '100%';
17409
17409
  this.browser = 'nd';
17410
+ this.pagination = false;
17411
+ this.paginationPageSize = 10;
17412
+ this.paginationAutoPageSize = false;
17410
17413
  this.tooltipShowDelay = 2000;
17411
17414
  this.elimina_label = 'ELIMINA';
17412
17415
  this.export_field_aggiuntivi = '';
@@ -17415,6 +17418,7 @@
17415
17418
  this.columnDefs = [];
17416
17419
  this.num_per_pag = 35;
17417
17420
  this.grid_key = 'PRO_H';
17421
+ this.service = 'dogridn';
17418
17422
  this.enabled = true;
17419
17423
  this.show_link = false;
17420
17424
  this.show_help_bar = false;
@@ -17425,6 +17429,7 @@
17425
17429
  this.enabled_pag = true;
17426
17430
  this.show_help = true;
17427
17431
  this.show_num_elem = true;
17432
+ this.private_pref = false;
17428
17433
  this.system_dest = 1;
17429
17434
  this.header_h = 35;
17430
17435
  this.selection_mode = 'multiple';
@@ -17439,6 +17444,9 @@
17439
17444
  this.label_elementi = ' Elementi';
17440
17445
  this.trova_label = 'TROVA';
17441
17446
  this.mantieni_impostazioni = 'Mantieni Imp.';
17447
+ this.row_height = 25;
17448
+ this.master_detail = false;
17449
+ this.detail_cell_renderer = null;
17442
17450
  this.curr_filter = '';
17443
17451
  this.show_buttons = true;
17444
17452
  this.fill_end = new i0.EventEmitter();
@@ -17450,6 +17458,7 @@
17450
17458
  this.custom_export = false;
17451
17459
  this.toolbar_type = 'NONE';
17452
17460
  this.toolbar_custom_commands = [];
17461
+ this.exec_params = [];
17453
17462
  this.command = new i0.EventEmitter();
17454
17463
  this.b_ensure = false;
17455
17464
  this.gf = null;
@@ -17713,6 +17722,7 @@
17713
17722
  this.dataSource = {
17714
17723
  //rowCount: ???, - not setting the row count, infinite paging will be used
17715
17724
  getRows: function (params) {
17725
+ // console.log('!!!!params ',params);
17716
17726
  // this code should contact the server for rows. however for the purposes of the demo,
17717
17727
  // the data is generated locally, a timer is used to give the experience of
17718
17728
  // an asynchronous call
@@ -17720,147 +17730,48 @@
17720
17730
  //console.log( params.filterModel);// + ' params.filterModel ' +params.filterModel);
17721
17731
  _this.m_appService.start();
17722
17732
  var p = { kd: _this.tbl_name };
17723
- // p.table = this.tbl_name;
17724
- // p.table_count = this.tbl_name;
17725
- //if (this.count_tbl_name != "") p.table_count = this.count_tbl_name;
17726
- // console.log(params);
17727
- p.num_per_pag = params.endRow - params.startRow;
17728
- // this.gridOptions.paginationPageSize = this.num_per_pag;
17729
- // this.gridOptions.cacheBlockSize = this.num_per_pag;
17730
- // console.log(this.gridOptions.cacheBlockSize );
17731
- // console.log(this.gridOptions.paginationPageSize );
17732
- p.curr_page = Math.round(params.startRow / p.num_per_pag);
17733
+ p.num_per_pag = params.request.endRow - params.request.startRow;
17734
+ p.fix_flt = (_this.fix_flt || '');
17735
+ p.curr_page = Math.round(params.request.startRow / p.num_per_pag);
17733
17736
  if (p.curr_page == null)
17734
17737
  p.curr_page = 0;
17735
17738
  if (p.num_per_pag == null)
17736
- p.num_per_pag = 100;
17739
+ p.num_per_pag = _this.num_per_pag;
17737
17740
  p.system_dest = _this.system_dest;
17741
+ p.exec_params = (_this.exec_params || []);
17738
17742
  p.p = JSON.stringify({
17739
- sort_model: params.sortModel,
17740
- filter_model: params.filterModel,
17743
+ sort_model: params.request.sortModel,
17744
+ filter_model: params.request.filterModel,
17741
17745
  free_search: _this.ric_libera,
17746
+ fix_flt: (_this.fix_flt || '')
17742
17747
  });
17743
- //p.sort_field = this.sort_field;
17744
- /*
17745
- if (params.sortModel != null)
17746
- if (params.sortModel.length > 0) {
17747
- p.sort_field = "";
17748
- for (var i: number = 0; i < params.sortModel.length; i++) {
17749
- if (p.sort_field != "") p.sort_field = p.sort_field + ",";
17750
- if (params.sortModel[i].colId == "autori")
17751
- p.sort_field =
17752
- p.sort_field +
17753
- "case when CHARINDEX('" +
17754
- this.m_appService.user +
17755
- "',autori)>0 then 1 else 0 end" +
17756
- " " +
17757
- params.sortModel[i].sort;
17758
- else
17759
- p.sort_field =
17760
- p.sort_field +
17761
- params.sortModel[i].colId +
17762
- " " +
17763
- params.sortModel[i].sort;
17764
- }
17765
- }
17766
-
17767
-
17768
-
17769
-
17770
- if (this.filters != null) p.filter = this.filters;
17771
-
17772
- if (this.fix_flt != "") {
17773
- if (p.filter != "") p.filter = p.filter + " and ";
17774
- p.filter = p.filter + " (" + this.fix_flt + " )";
17775
- }
17776
-
17777
- if (this.fix_flt_temp != "") {
17778
- if (p.filter != "") p.filter = p.filter + " and ";
17779
- p.filter = p.filter + " (" + this.fix_flt_temp + " )";
17780
- }
17781
-
17782
- // console.log('Filter model');
17783
- //console.log(params.filterModel);
17784
-
17785
- if (params.filterModel != null) {
17786
- // console.log('Filtri');
17787
-
17788
- for (let key in params.filterModel) {
17789
- // console.log(key);
17790
- // if (p.hasOwnProperty(key)) {
17791
- // console.log( params.filterModel[key]);
17792
- let obj_filtro_test = params.filterModel[key];
17793
- console.log(params.filterModel[key], key);
17794
- if (obj_filtro_test.operator == null) {
17795
- if (p.filter == "")
17796
- p.filter += this.calcola_filtro(
17797
- params.filterModel[key],
17798
- "",
17799
- key,
17800
- false
17801
- );
17802
- else
17803
- p.filter += this.calcola_filtro(
17804
- params.filterModel[key],
17805
- "",
17806
- key,
17807
- true
17808
- );
17809
- } else {
17810
- if (p.filter != "") p.filter += " and ";
17811
- p.filter += " (";
17812
- p.filter += this.calcola_filtro(
17813
- params.filterModel[key].condition1,
17814
- "",
17815
- key,
17816
- false
17817
- );
17818
-
17819
- p.filter += " " + obj_filtro_test.operator + " ";
17820
- p.filter += this.calcola_filtro(
17821
- params.filterModel[key].condition2,
17822
- "",
17823
- key,
17824
- false
17825
- );
17826
-
17827
- p.filter += ")";
17828
- }
17829
- // }
17830
- }
17831
- }
17832
-
17833
- (data) => {
17834
- //p.num_per_pag=5000;
17835
- // console.log(this._gridservice);
17836
- this.str_curr_q_p = "";
17837
- if (p.filter != "") this.str_curr_q_p = "where " + p.filter;
17838
- if (p.sort_field != "")
17839
- this.str_curr_q_p = this.str_curr_q_p + " order by " + p.sort_field;
17840
- this.curr_filter = p.filter;*/
17841
- //console.log('params.filterModel ',params.filterModel, JSON.stringify(params.filterModel));
17842
- if ((params.filterModel == null ||
17843
- JSON.stringify(params.filterModel) == '{}') &&
17748
+ if ((params.request.filterModel == null ||
17749
+ JSON.stringify(params.request.filterModel) == '{}') &&
17844
17750
  (_this.ric_libera == null || _this.ric_libera == ''))
17845
17751
  _this.show_pulisci_filtri = false;
17846
17752
  else
17847
17753
  _this.show_pulisci_filtri = true;
17848
- // this._gridservice.url='https://web.raytecvision.com/test/api/dogridn';
17849
- _this.p_fi = { kd: p.kd, system_dest: p.system_dest, p: p.p };
17754
+ _this.p_fi = {
17755
+ kd: p.kd,
17756
+ system_dest: p.system_dest, exec_params: (_this.exec_params || []),
17757
+ p: p.p,
17758
+ fix_flt: (_this.fix_flt || '')
17759
+ };
17850
17760
  _this._gridservice
17851
- .doQuery(p, true, _this.m_appService.API_ENDPOINT + 'dogridn')
17761
+ .doQuery(p, true, _this.m_appService.API_ENDPOINT + _this.service)
17852
17762
  .subscribe(function (data) {
17853
17763
  var ok_op = false;
17854
17764
  if (data != null)
17855
17765
  if (data.result_msg == 'OK') {
17856
17766
  ok_op = true;
17857
- // console.log(data.result_data);
17767
+ // console.log(data.result_data, data.count);
17858
17768
  params.successCallback(data.result_data, data.count);
17859
17769
  _this.b_init = true;
17860
17770
  _this.myData = data.result_data.slice();
17861
17771
  _this.num_r = data.count;
17862
17772
  _this.m_appService.complete();
17863
17773
  _this.fill_end.emit();
17774
+ _this.check_width();
17864
17775
  // console.log("end");
17865
17776
  // console.log(localStorage.getItem(this.grid_key+'_POS'));
17866
17777
  localStorage.setItem(_this.grid_key + '_POS1', JSON.stringify(p));
@@ -17884,7 +17795,8 @@
17884
17795
  var b_mantieni_ck = false;
17885
17796
  if (_this.toggle_mantieni != null)
17886
17797
  b_mantieni_ck = _this.toggle_mantieni.checked;
17887
- if (_this.no_pref && !_this.b_init1) {
17798
+ if (_this.no_pref && !_this.b_init1 &&
17799
+ _this.autosize_at_ini) {
17888
17800
  _this.autoSizeAll();
17889
17801
  }
17890
17802
  _this.b_init1 = true;
@@ -17952,102 +17864,7 @@
17952
17864
  icon: '<img src="assets/icons/square-o/xlsx.svg"/>',
17953
17865
  },
17954
17866
  ]; };
17955
- this.gridOptions = {
17956
- debug: false,
17957
- headerHeight: this.header_h,
17958
- enableRangeSelection: true,
17959
- defaultColDef: { resizable: true, sortable: true, floatingFilter: true },
17960
- allowContextMenuWithControlKey: true,
17961
- rowModelType: 'infinite',
17962
- localeText: {
17963
- // for filter panel
17964
- page: 'pagina',
17965
- more: 'altre',
17966
- to: 'a',
17967
- of: 'di',
17968
- next: 'prossima',
17969
- last: 'ultima',
17970
- first: 'prima',
17971
- previous: 'precedente',
17972
- loadingOoo: 'Caricamento...',
17973
- // for set filter
17974
- selectAll: 'Seleziona Tutto',
17975
- searchOoo: 'Trova...',
17976
- blanks: 'Vuoto',
17977
- // for number filter and text filter
17978
- filterOoo: 'Filtro...',
17979
- applyFilter: 'Applica Filtro...',
17980
- // for number filter
17981
- equals: 'Uguale',
17982
- notEqual: 'Diverso',
17983
- lessThan: 'Minore o Uguale',
17984
- greaterThan: 'Maggiore o Uguale',
17985
- // for text filter
17986
- notContains: 'Non Contiene',
17987
- contains: 'Contiene',
17988
- startsWith: 'Inizia Con',
17989
- endsWith: 'Finisce Con',
17990
- // the header of the default group column
17991
- group: 'Gruppo',
17992
- // tool panel
17993
- columns: 'Colonne',
17994
- rowGroupColumns: 'Colonne Pivot',
17995
- rowGroupColumnsEmptyMessage: 'trascina le colonne per raggrupparle',
17996
- valueColumns: 'Colonne Valore',
17997
- pivotMode: 'Modalità Pivot',
17998
- groups: 'Gruppi',
17999
- values: 'Valori',
18000
- pivots: 'Pivots',
18001
- valueColumnsEmptyMessage: 'trascina le colonne per aggreare',
18002
- pivotColumnsEmptyMessage: 'trascina le colonne per pivot',
18003
- // other
18004
- noRowsToShow: 'nessun dato',
18005
- // enterprise menu
18006
- pinColumn: 'Sposta Colonna',
18007
- valueAggregation: 'Aggregazione',
18008
- autosizeThiscolumn: 'Autosize colonna',
18009
- autosizeAllColumns: 'Autosize tutte le colonne',
18010
- groupBy: 'Raggruppa per',
18011
- ungroupBy: 'Spacca per',
18012
- resetColumns: 'Resetta queste colonna',
18013
- expandAll: 'Espandi',
18014
- collapseAll: 'Chiudi',
18015
- toolPanel: 'Impostazioni',
18016
- // enterprise menu pinning
18017
- pinLeft: 'Sposta <<',
18018
- pinRight: 'Sposta >>',
18019
- noPin: 'Sposta <>',
18020
- // enterprise menu aggregation and status panel
18021
- sum: 'Somma',
18022
- min: 'Minimo',
18023
- max: 'Massimo',
18024
- none: 'Nessuno',
18025
- count: 'Numero',
18026
- average: 'Media',
18027
- // standard menu
18028
- copy: 'Copia',
18029
- ctrlC: 'ctrl n C',
18030
- paste: 'Incolla',
18031
- ctrlV: 'ctrl n C',
18032
- },
18033
- getRowNodeId: function (item) {
18034
- // console.log(item);
18035
- if (item.ID != null)
18036
- return String(item.ID);
18037
- if (item.id != null)
18038
- return String(item.id);
18039
- if (item.uiid != null)
18040
- return item.uiid;
18041
- if (item.codice != null)
18042
- return item.codice;
18043
- if (item.id_doc != null)
18044
- return item.id_doc;
18045
- if (item.notesid != null)
18046
- return item.notesid;
18047
- if (item.ord != null)
18048
- return item.ord;
18049
- },
18050
- };
17867
+ this.gridOptions = {};
18051
17868
  this.last_copy = '';
18052
17869
  this.showGrid = true;
18053
17870
  this.rowData = [];
@@ -18056,6 +17873,7 @@
18056
17873
  this.b_init1 = false;
18057
17874
  this.errorMsg = '';
18058
17875
  this.innerWidth = 750;
17876
+ this.init_opt = false;
18059
17877
  this.show_pulisci_filtri = false;
18060
17878
  this.uiid_stampa = '';
18061
17879
  this.xxopx = 0;
@@ -18092,6 +17910,20 @@
18092
17910
  return 'other';
18093
17911
  }
18094
17912
  };
17913
+ FHGridComponentN.prototype.check_width = function () {
17914
+ var _this = this;
17915
+ if (!this.autosize_at_ini)
17916
+ return;
17917
+ setTimeout(function () {
17918
+ //get columns size
17919
+ var go = _this.gridOptions.columnApi;
17920
+ if (go.getColumnState()[0].width < 24) {
17921
+ setTimeout(function () {
17922
+ _this.autoSizeAll();
17923
+ }, 1000);
17924
+ }
17925
+ }, 100);
17926
+ };
18095
17927
  FHGridComponentN.prototype.docmd = function (o) {
18096
17928
  this.command.emit(o);
18097
17929
  };
@@ -18136,7 +17968,6 @@
18136
17968
  if (this.curr_config == '-1')
18137
17969
  return;
18138
17970
  localStorage.removeItem(this.grid_key + '_COLS');
18139
- // localStorage.removeItem(this.grid_key + "_SORT");
18140
17971
  localStorage.removeItem(this.grid_key + '_FILTER');
18141
17972
  localStorage.removeItem(this.grid_key + '_CFG_DEFAULT');
18142
17973
  localStorage.removeItem(this.grid_key + '_FILTER_UP');
@@ -18425,7 +18256,7 @@
18425
18256
  this.gridOptions.api.setHeaderHeight(this.header_h);
18426
18257
  this.gridOptions.suppressCopyRowsToClipboard = true;
18427
18258
  this.gridOptions.sendToClipboard = function (v) {
18428
- console.log('v ', v);
18259
+ // console.log('v ', v);
18429
18260
  if (_this.enable_copy)
18430
18261
  _this.gridApi.copySelectedRangeToClipboard();
18431
18262
  {
@@ -18449,6 +18280,108 @@
18449
18280
  };
18450
18281
  FHGridComponentN.prototype.ngAfterViewInit = function () {
18451
18282
  var _this = this;
18283
+ this.gridOptions = {
18284
+ debug: false,
18285
+ pagination: this.pagination,
18286
+ paginationPageSize: this.paginationPageSize,
18287
+ cacheBlockSize: this.num_per_pag,
18288
+ headerHeight: this.header_h,
18289
+ paginationAutoPageSize: this.paginationAutoPageSize,
18290
+ rowHeight: this.row_height,
18291
+ enableRangeSelection: true,
18292
+ defaultColDef: { resizable: true, sortable: true, floatingFilter: true },
18293
+ allowContextMenuWithControlKey: true,
18294
+ rowModelType: 'serverSide',
18295
+ localeText: {
18296
+ // for filter panel
18297
+ page: 'pagina',
18298
+ more: 'altre',
18299
+ to: 'a',
18300
+ of: 'di',
18301
+ next: 'prossima',
18302
+ last: 'ultima',
18303
+ first: 'prima',
18304
+ previous: 'precedente',
18305
+ loadingOoo: 'Caricamento...',
18306
+ // for set filter
18307
+ selectAll: 'Seleziona Tutto',
18308
+ searchOoo: 'Trova...',
18309
+ blanks: 'Vuoto',
18310
+ // for number filter and text filter
18311
+ filterOoo: 'Filtro...',
18312
+ applyFilter: 'Applica Filtro...',
18313
+ // for number filter
18314
+ equals: 'Uguale',
18315
+ notEqual: 'Diverso',
18316
+ lessThan: 'Minore o Uguale',
18317
+ greaterThan: 'Maggiore o Uguale',
18318
+ // for text filter
18319
+ notContains: 'Non Contiene',
18320
+ contains: 'Contiene',
18321
+ startsWith: 'Inizia Con',
18322
+ endsWith: 'Finisce Con',
18323
+ // the header of the default group column
18324
+ group: 'Gruppo',
18325
+ // tool panel
18326
+ columns: 'Colonne',
18327
+ rowGroupColumns: 'Colonne Pivot',
18328
+ rowGroupColumnsEmptyMessage: 'trascina le colonne per raggrupparle',
18329
+ valueColumns: 'Colonne Valore',
18330
+ pivotMode: 'Modalità Pivot',
18331
+ groups: 'Gruppi',
18332
+ values: 'Valori',
18333
+ pivots: 'Pivots',
18334
+ valueColumnsEmptyMessage: 'trascina le colonne per aggreare',
18335
+ pivotColumnsEmptyMessage: 'trascina le colonne per pivot',
18336
+ // other
18337
+ noRowsToShow: 'nessun dato',
18338
+ // enterprise menu
18339
+ pinColumn: 'Sposta Colonna',
18340
+ valueAggregation: 'Aggregazione',
18341
+ autosizeThiscolumn: 'Autosize colonna',
18342
+ autosizeAllColumns: 'Autosize tutte le colonne',
18343
+ groupBy: 'Raggruppa per',
18344
+ ungroupBy: 'Spacca per',
18345
+ resetColumns: 'Resetta queste colonna',
18346
+ expandAll: 'Espandi',
18347
+ collapseAll: 'Chiudi',
18348
+ toolPanel: 'Impostazioni',
18349
+ // enterprise menu pinning
18350
+ pinLeft: 'Sposta <<',
18351
+ pinRight: 'Sposta >>',
18352
+ noPin: 'Sposta <>',
18353
+ // enterprise menu aggregation and status panel
18354
+ sum: 'Somma',
18355
+ min: 'Minimo',
18356
+ max: 'Massimo',
18357
+ none: 'Nessuno',
18358
+ count: 'Numero',
18359
+ average: 'Media',
18360
+ // standard menu
18361
+ copy: 'Copia',
18362
+ ctrlC: 'ctrl n C',
18363
+ paste: 'Incolla',
18364
+ ctrlV: 'ctrl n C',
18365
+ },
18366
+ getRowNodeId: function (item) {
18367
+ // console.log(item);
18368
+ if (item.ID != null)
18369
+ return String(item.ID);
18370
+ if (item.id != null)
18371
+ return String(item.id);
18372
+ if (item.uiid != null)
18373
+ return item.uiid;
18374
+ if (item.codice != null)
18375
+ return item.codice;
18376
+ if (item.id_doc != null)
18377
+ return item.id_doc;
18378
+ if (item.notesid != null)
18379
+ return item.notesid;
18380
+ if (item.ord != null)
18381
+ return item.ord;
18382
+ },
18383
+ };
18384
+ this.init_opt = true;
18452
18385
  if (this.grid_key == 'PRO_H')
18453
18386
  this.no_pref = true;
18454
18387
  setTimeout(function () {
@@ -18464,7 +18397,7 @@
18464
18397
  FHGridComponentN.prototype.okr = function (event) {
18465
18398
  //console.log(event.column.colDef.field);
18466
18399
  event.data.nome_colonna = event.column.colDef.field;
18467
- this.cell_edited.emit(event);
18400
+ this.cell_edited.emit(event.data);
18468
18401
  };
18469
18402
  FHGridComponentN.prototype.help_window = function () {
18470
18403
  var dialogRef = this.m_dialog.open(win_grid_help, { disableClose: true });
@@ -18494,6 +18427,7 @@
18494
18427
  };
18495
18428
  FHGridComponentN.prototype.autoSizeAll = function () {
18496
18429
  var _this = this;
18430
+ // console.log("🚀 ~ file: fhgridn.ts:1121 ~ FHGridComponentN ~ autoSizeAll ~ autoSizeAll:")
18497
18431
  if (this.gridOptions == null)
18498
18432
  return;
18499
18433
  if (this.gridOptions.columnApi == null)
@@ -18513,6 +18447,7 @@
18513
18447
  this.save_cfg();
18514
18448
  };
18515
18449
  FHGridComponentN.prototype.fitSizeAll = function () {
18450
+ // console.log("🚀 ~ file: fhgridn.ts:1142 ~ FHGridComponentN ~ fitSizeAll ~ fitSizeAll:")
18516
18451
  // console.log("fitSizeAll");
18517
18452
  if (this.gridOptions.api)
18518
18453
  this.gridOptions.api.sizeColumnsToFit();
@@ -18584,7 +18519,7 @@
18584
18519
  if (this.gridOptions.api)
18585
18520
  this.gridOptions.api.setFilterModel(null);
18586
18521
  var filtrtm = {}; /*
18587
- this.columnDefs.map((v)=>{
18522
+ this.columnDefs.map((v:any)=>{
18588
18523
  if(v.filter=='agSetColumnFilter'){
18589
18524
  filtrtm[v.field]={type:'set',values:[]}
18590
18525
  }
@@ -18592,141 +18527,6 @@
18592
18527
  if (this.gridOptions.api)
18593
18528
  this.gridOptions.api.setFilterModel(filtrtm);
18594
18529
  };
18595
- /*
18596
- public export_excel(format: string = "xlsx") {
18597
- if(this.custom_export){
18598
- this.command.emit({ cmd: "export_excel",v:format });
18599
- return;}
18600
- if (this.num_r > 20000) {
18601
- this._toast.error("Massimo 20000 elementi esportabili");
18602
- return;
18603
- }
18604
- format = "." + format;
18605
-
18606
- this.uiid_stampa = this.uti_s.newGuid();
18607
- this.xxopx = 0;
18608
- let q: string = "";
18609
- this.dialogRef_W = this.m_dialog.open(fh_win_wait, {
18610
- disableClose: true,
18611
- });
18612
- setTimeout(() => {
18613
- this.dialogRef_W.componentInstance.label = "EXPORT IN CORSO";
18614
- });
18615
- let cmds: Array<any> = [];
18616
-
18617
- let str_fields = "";
18618
- let p_col = this.gridOptions.columnApi.getAllDisplayedColumns();
18619
-
18620
- for (let j = 0; j < p_col.length; j++) {
18621
- if (str_fields != "") str_fields += ",";
18622
- if (p_col[j].getColDef().headerName == null)
18623
- str_fields += "[" + p_col[j].getColDef().field + "]";
18624
- else if (p_col[j].getColDef().headerName == "")
18625
- str_fields += "[" + p_col[j].getColDef().field + "]";
18626
- else
18627
- str_fields +=
18628
- "[" +
18629
- p_col[j].getColDef().field +
18630
- "] [" +
18631
- p_col[j].getColDef().headerName.split('[').join('').split(']').join('') +
18632
- "]";
18633
- }
18634
- if (this.fields.indexOf("DISTINCT") != -1)
18635
- str_fields = "DISTINCT " + str_fields;
18636
- cmds.push(
18637
- this.officeService.operation(
18638
- "GB_XLS_APRI",
18639
- "tpl_report.xlsx",
18640
- "" + this.uiid_stampa + ".xlsx",
18641
- this.xxopx++
18642
- )
18643
- );
18644
- let opx:string='GB_CREA_TABELLA_FROM_DB';
18645
- if(this.system_dest==2)opx='GB_CREA_TABELLA_FROM_DB1';
18646
- if(this.export_field_aggiuntivi=='')
18647
- cmds.push(
18648
- this.officeService.operation(
18649
- opx,
18650
- "select " +
18651
- str_fields+
18652
- " from " +
18653
- this.tbl_name +
18654
- " " +
18655
- this.str_curr_q_p,
18656
- "3",
18657
- this.xxopx++
18658
- )
18659
- );
18660
- else
18661
- cmds.push(
18662
- this.officeService.operation(
18663
- opx,
18664
- "select " +
18665
- str_fields +','+this.export_field_aggiuntivi+
18666
- " from " +
18667
- this.tbl_name +
18668
- " " +
18669
- this.str_curr_q_p,
18670
- "3",
18671
- this.xxopx++
18672
- )
18673
- );
18674
- cmds.push(
18675
- this.officeService.operation(
18676
- "GB_XLS_SAVE",
18677
- this.m_appService.LOCAL_PATH +
18678
- "grid_reports\\" +
18679
- this.uiid_stampa +
18680
- "_" +
18681
- this.m_appService.user +
18682
- format,
18683
- "",
18684
- this.xxopx++
18685
- )
18686
- );
18687
-
18688
- this.officeService
18689
- .runCommands(this.uiid_stampa, cmds, this.dialogRef_W,false)
18690
- .subscribe((data) => {
18691
- this.check_end(format);
18692
- });
18693
- }
18694
- check_end(format:any){
18695
-
18696
-
18697
- let p: FSInput = new FSInput();
18698
- p.p1 =
18699
- this.m_appService.LOCAL_PATH +
18700
- "grid_reports\\" +
18701
- this.uiid_stampa +
18702
- "_" +
18703
- this.m_appService.user +
18704
- format;
18705
- p.command = "check_file";
18706
- this._fileService.doQuery(p).subscribe((data) => {
18707
- if (data != null)
18708
- if (data.msg == "N") {
18709
- setTimeout(() => {
18710
- this.check_end(format);
18711
- },5000);
18712
- } else {
18713
- setTimeout(() => {
18714
- this.dialogRef_W.componentInstance.update_progess(100);
18715
- });
18716
- window.open(
18717
- this.m_appService.COMPANY_SITE_ROOT +
18718
- "/grid_reports/" +
18719
- this.uiid_stampa +
18720
- "_" +
18721
- this.m_appService.user +
18722
- format
18723
- );
18724
- }
18725
- });
18726
-
18727
- }
18728
-
18729
- */
18730
18530
  FHGridComponentN.prototype.print = function () {
18731
18531
  if (this.custom_export)
18732
18532
  this.command.emit({ cmd: 'print_pdf' });
@@ -18865,6 +18665,7 @@
18865
18665
  FHGridComponentN.prototype.res_columns = function (forza) {
18866
18666
  var _this = this;
18867
18667
  if (forza === void 0) { forza = false; }
18668
+ console.log("🚀 ~ file: fhgridn.ts:1370 ~ FHGridComponentN ~ res_columns ~ res_columns:", forza);
18868
18669
  if (this.columnDefs == null) {
18869
18670
  setTimeout(function () {
18870
18671
  _this.res_columns(forza);
@@ -18887,9 +18688,11 @@
18887
18688
  return;
18888
18689
  }
18889
18690
  if (localStorage.getItem(this.grid_key + '_COLS') != null &&
18890
- (b_mantieni_ck || forza))
18691
+ (b_mantieni_ck || forza)) {
18692
+ // console.log('qqqqq1111');
18891
18693
  if (localStorage.getItem(this.grid_key + '_COLS') != '') {
18892
18694
  b_rip = true;
18695
+ // console.log('qqqqq2222');
18893
18696
  try {
18894
18697
  var a = JSON.parse((localStorage.getItem(this.grid_key + '_COLS') || '[]'));
18895
18698
  var annulla = true;
@@ -18897,16 +18700,24 @@
18897
18700
  if (!a[i].hide)
18898
18701
  annulla = false;
18899
18702
  }
18703
+ // console.log('qqqqq3333 ',annulla);
18900
18704
  if (annulla)
18901
18705
  localStorage.getItem(this.grid_key + '_COLS');
18902
- else if (localStorage.getItem(this.grid_key + '_COLS'))
18903
- if (this.gridOptions.columnApi)
18904
- this.gridOptions.columnApi.setColumnState((JSON.parse(localStorage.getItem(this.grid_key + '_COLS') || '{}')));
18706
+ else {
18707
+ // console.log('qqqqq4444');
18708
+ if (localStorage.getItem(this.grid_key + '_COLS'))
18709
+ if (this.gridOptions.columnApi) {
18710
+ // console.log('qqqqq5555',JSON.parse(localStorage.getItem(this.grid_key + '_COLS')||'{}'));
18711
+ var colState = { state: JSON.parse(localStorage.getItem(this.grid_key + '_COLS') || '{}') };
18712
+ this.gridOptions.columnApi.applyColumnState(colState);
18713
+ }
18714
+ }
18905
18715
  }
18906
18716
  catch (eer) {
18907
18717
  console.log(eer);
18908
18718
  }
18909
18719
  }
18720
+ }
18910
18721
  /* try {
18911
18722
  this.gridOptions.api.setSortModel(null);
18912
18723
  } catch (eer) {
@@ -18962,7 +18773,7 @@
18962
18773
  _this.ref_dt();
18963
18774
  }, 500);
18964
18775
  else
18965
- this.gridOptions.api.setDatasource(this.dataSource);
18776
+ this.gridOptions.api.setServerSideDatasource(this.dataSource);
18966
18777
  }
18967
18778
  };
18968
18779
  FHGridComponentN.prototype.updateRow = function () {
@@ -18972,12 +18783,19 @@
18972
18783
  // console.log('onModelUpdated');
18973
18784
  // this.calculateRowCount();
18974
18785
  };
18786
+ FHGridComponentN.prototype.doSearch = function (s) {
18787
+ this.ric_libera = s;
18788
+ this.free_search();
18789
+ };
18975
18790
  FHGridComponentN.prototype.onReady = function (event) {
18976
18791
  // console.log(this.header_h);
18977
18792
  this.gridApi = event.api;
18978
18793
  this.setHeaderHeight(this.header_h);
18979
18794
  if (this.gf != null && this.show_buttons && !this.pref_hidden) {
18980
- this.gf.sql = 'SELECT_CFG_GRID';
18795
+ if (!this.private_pref)
18796
+ this.gf.sql = 'SELECT_CFG_GRID';
18797
+ else
18798
+ this.gf.sql = 'SELECT_CFG_GRID_BY_USER';
18981
18799
  this.gf.types = ['string'];
18982
18800
  this.gf.values = [this.grid_key];
18983
18801
  this.gf.fillCombo();
@@ -19094,7 +18912,7 @@
19094
18912
  }
19095
18913
  });
19096
18914
  if (ss_r != '') {
19097
- console.log('ADDO '), ss_r;
18915
+ // console.log('ADDO '), ss_r;
19098
18916
  if (ss != '')
19099
18917
  ss += ' and ';
19100
18918
  ss += '(' + ss_r + ')';
@@ -19108,6 +18926,8 @@
19108
18926
  this.doFill_Temp(ss, true);
19109
18927
  };
19110
18928
  FHGridComponentN.prototype.onCellClicked = function (event) {
18929
+ if (!this.b_init)
18930
+ return;
19111
18931
  // console.log(event.rowIndex + ' ' + event.colDef.field);
19112
18932
  this.cell_clicked.emit(event);
19113
18933
  // console.log(this.myModalNormal);
@@ -19126,7 +18946,7 @@
19126
18946
  FHGridComponentN.prototype.onCellFocused = function (event) {
19127
18947
  //console.log('onCellFocused: (' + event.rowIndex + ',' + event.colIndex + ')');
19128
18948
  };
19129
- FHGridComponentN.prototype.onSelectionChanged = function () {
18949
+ FHGridComponentN.prototype.onSelectionChanged = function (event) {
19130
18950
  // console.log('selectionChanged');
19131
18951
  };
19132
18952
  FHGridComponentN.prototype.onBeforeFilterChanged = function () {
@@ -19134,6 +18954,8 @@
19134
18954
  };
19135
18955
  FHGridComponentN.prototype.oncolumnEverythingChanged = function (event) {
19136
18956
  // console.log('oncolumnEverythingChanged');
18957
+ if (!this.b_init)
18958
+ return;
19137
18959
  if (this.b_init) {
19138
18960
  // console.log('salvo f: '+JSON.stringify(this.gridOptions.columnApi.getColumnState()));
19139
18961
  if (this.gridOptions.columnApi)
@@ -19142,6 +18964,8 @@
19142
18964
  };
19143
18965
  FHGridComponentN.prototype.onFilterModified = function () {
19144
18966
  var _this = this;
18967
+ if (!this.b_init)
18968
+ return;
19145
18969
  if (this.no_pref)
19146
18970
  return;
19147
18971
  setTimeout(function () {
@@ -19176,6 +19000,8 @@
19176
19000
  // console.log('onVirtualRowRemoved: ' + event.rowIndex);
19177
19001
  };
19178
19002
  FHGridComponentN.prototype.onRowClicked = function ($event) {
19003
+ if (!this.b_init)
19004
+ return;
19179
19005
  //console.log('onRowClicked: ' );
19180
19006
  var selectedInGrid;
19181
19007
  if (this.gridOptions.api)
@@ -19200,6 +19026,8 @@
19200
19026
  }
19201
19027
  };
19202
19028
  FHGridComponentN.prototype.onRowDClicked = function ($event) {
19029
+ if (!this.b_init)
19030
+ return;
19203
19031
  //console.log('onRowClicked: ' );
19204
19032
  //console.log(event);
19205
19033
  this.dclicked.emit($event.data);
@@ -19216,6 +19044,8 @@
19216
19044
  // here we use one generic event to handle all the column type events.
19217
19045
  // the method just prints the event name
19218
19046
  FHGridComponentN.prototype.onColumnEvent = function ($event) {
19047
+ if (!this.b_init)
19048
+ return;
19219
19049
  this.columndclicked.emit($event);
19220
19050
  // console.log('onColumnEvent: ' + $event);
19221
19051
  // localStorage.setItem(this.grid_key+'_COLUMN',JSON.stringify(this.gridOptions.api.getColumnDef()));
@@ -19276,6 +19106,9 @@
19276
19106
  { type: clipboard.Clipboard }
19277
19107
  ]; };
19278
19108
  FHGridComponentN.propDecorators = {
19109
+ pagination: [{ type: i0.Input }],
19110
+ paginationPageSize: [{ type: i0.Input }],
19111
+ paginationAutoPageSize: [{ type: i0.Input }],
19279
19112
  tooltipShowDelay: [{ type: i0.Input }],
19280
19113
  elimina_label: [{ type: i0.Input }],
19281
19114
  export_field_aggiuntivi: [{ type: i0.Input }],
@@ -19284,6 +19117,7 @@
19284
19117
  columnDefs: [{ type: i0.Input }],
19285
19118
  num_per_pag: [{ type: i0.Input }],
19286
19119
  grid_key: [{ type: i0.Input }],
19120
+ service: [{ type: i0.Input }],
19287
19121
  enabled: [{ type: i0.Input }],
19288
19122
  show_link: [{ type: i0.Input }],
19289
19123
  show_help_bar: [{ type: i0.Input }],
@@ -19294,6 +19128,8 @@
19294
19128
  enabled_pag: [{ type: i0.Input }],
19295
19129
  show_help: [{ type: i0.Input }],
19296
19130
  show_num_elem: [{ type: i0.Input }],
19131
+ private_pref: [{ type: i0.Input }],
19132
+ icons: [{ type: i0.Input }],
19297
19133
  system_dest: [{ type: i0.Input }],
19298
19134
  header_h: [{ type: i0.Input }],
19299
19135
  selection_mode: [{ type: i0.Input }],
@@ -19308,6 +19144,9 @@
19308
19144
  label_elementi: [{ type: i0.Input }],
19309
19145
  trova_label: [{ type: i0.Input }],
19310
19146
  mantieni_impostazioni: [{ type: i0.Input }],
19147
+ row_height: [{ type: i0.Input }],
19148
+ master_detail: [{ type: i0.Input }],
19149
+ detail_cell_renderer: [{ type: i0.Input }],
19311
19150
  show_buttons: [{ type: i0.Input }],
19312
19151
  fill_end: [{ type: i0.Output }],
19313
19152
  cell_edited: [{ type: i0.Output }],
@@ -19319,6 +19158,7 @@
19319
19158
  toolbar_type: [{ type: i0.Input }],
19320
19159
  toolbar_wkfapp: [{ type: i0.Input }],
19321
19160
  toolbar_custom_commands: [{ type: i0.Input }],
19161
+ exec_params: [{ type: i0.Input }],
19322
19162
  command: [{ type: i0.Output }],
19323
19163
  gf: [{ type: i0.ViewChild, args: ['gf',] }],
19324
19164
  toggle_mantieni: [{ type: i0.ViewChild, args: ['toggle_mantieni',] }],