@nettyapps/ntybase 21.1.26 → 21.1.27

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.
@@ -1596,6 +1596,14 @@ class NettyAgGridBase extends NettyAppsBase {
1596
1596
  }
1597
1597
  sessionStorage.setItem(this.searchValueName(), this.searchValue());
1598
1598
  }
1599
+ async refreshData() {
1600
+ try {
1601
+ this.loadData();
1602
+ }
1603
+ catch (err) {
1604
+ this.alertService.showError(err);
1605
+ }
1606
+ }
1599
1607
  /**
1600
1608
  * Update a single row in the grid
1601
1609
  * @param rowData The updated row data
@@ -1607,7 +1615,7 @@ class NettyAgGridBase extends NettyAppsBase {
1607
1615
  const field = idField || this.pkFieldName();
1608
1616
  const id = rowData[field];
1609
1617
  if (id === undefined || id === null) {
1610
- this.loadData();
1618
+ this.refreshData();
1611
1619
  return;
1612
1620
  }
1613
1621
  let rowNode = this.gridApi.getRowNode(id.toString());
@@ -1622,8 +1630,9 @@ class NettyAgGridBase extends NettyAppsBase {
1622
1630
  }
1623
1631
  if (rowNode) {
1624
1632
  rowNode.setData(rowData);
1625
- const params = { rowNodes: [rowNode], force: true, suppressFlash: false, };
1633
+ const params = { rowNodes: [rowNode], force: true, suppressFlash: false };
1626
1634
  this.gridApi.refreshCells(params);
1635
+ this.recordList.update(currentList => currentList.map(item => item[field] === id ? rowData : item));
1627
1636
  }
1628
1637
  else {
1629
1638
  this.loadData(); // Reload all data if row not found
@@ -1930,7 +1939,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImpor
1930
1939
 
1931
1940
  ModuleRegistry.registerModules([AllCommunityModule, StatusBarModule, ClientSideRowModelModule, ClipboardModule, ExcelExportModule, ColumnMenuModule,
1932
1941
  ContextMenuModule, CellSelectionModule, HighlightChangesModule, RowSelectionModule, SetFilterModule, MultiFilterModule, TextFilterModule, NumberFilterModule, DateFilterModule]);
1933
- // AgGrid Dark Mode Row Style
1934
1942
  class NettyAgGridListBase extends NettyAgGridBase {
1935
1943
  // ********************************************
1936
1944
  // *** INPUTS ***
@@ -2109,14 +2117,6 @@ class NettyAgGridListBase extends NettyAgGridBase {
2109
2117
  error: (err) => this.alertService.showError('@dataLoadFailed', err),
2110
2118
  });
2111
2119
  }
2112
- async refreshData() {
2113
- try {
2114
- this.loadData();
2115
- }
2116
- catch (err) {
2117
- this.alertService.showError(err);
2118
- }
2119
- }
2120
2120
  async deleteSelected() {
2121
2121
  if (!this.gridApi)
2122
2122
  return;
@@ -2300,12 +2300,7 @@ class NettyAgGridListFilterBase extends NettyAgGridListBase {
2300
2300
  * Triggers the filter component to refresh its data
2301
2301
  */
2302
2302
  refreshFilterData() {
2303
- let value = this.filterRefreshTrigger();
2304
- if (value > 10000) {
2305
- value = 0;
2306
- }
2307
- value++;
2308
- this.filterRefreshTrigger.set(value);
2303
+ this.filterRefreshTrigger.update(val => val > 10000 ? 1 : val + 1);
2309
2304
  }
2310
2305
  onReverseIsFilterValid() {
2311
2306
  this.isFilterValid.update((a) => !a);
@@ -2369,14 +2364,6 @@ class NettyAgGridLogBase extends NettyAgGridBase {
2369
2364
  error: (err) => this.alertService.showError('@dataLoadFailed', err),
2370
2365
  });
2371
2366
  }
2372
- async refreshData() {
2373
- try {
2374
- this.loadData();
2375
- }
2376
- catch (err) {
2377
- this.alertService.showError(err);
2378
- }
2379
- }
2380
2367
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NettyAgGridLogBase, deps: null, target: i0.ɵɵFactoryTarget.Component });
2381
2368
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.2", type: NettyAgGridLogBase, isStandalone: true, selector: "ntybase-ag-grid-log-base", host: { attributes: { "ntybase-id": "NettyAgGridLogBase" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
2382
2369
  }
@@ -2601,7 +2588,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
2601
2588
  this.nettyAppsProxy.update(updateData).subscribe({
2602
2589
  next: (updatedRecord) => {
2603
2590
  this.initializeFormData(updatedRecord);
2604
- this.commonService.notifyUpdate('Item', 'update', updatedRecord);
2591
+ this.commonService.notifyUpdate(this.recordType(), 'update', updatedRecord);
2605
2592
  this.closeSidenav();
2606
2593
  this.alertService.showSuccess('@recordUpdatedSuccessfully');
2607
2594
  },
@@ -2695,12 +2682,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
2695
2682
  disableClose: true,
2696
2683
  hasBackdrop: false,
2697
2684
  })
2698
- .afterClosed()
2699
- .subscribe((result) => {
2700
- if (result === 'saved') {
2701
- //this.updateRowInGrid;
2702
- }
2703
- });
2685
+ .afterClosed();
2704
2686
  return;
2705
2687
  }
2706
2688
  // Log control