@nettyapps/ntybase 21.1.17 → 21.1.19
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.
|
@@ -1654,18 +1654,25 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1654
1654
|
this.nettyAgGridService.setAgGridTranslations(this.gridApi);
|
|
1655
1655
|
}
|
|
1656
1656
|
initAgGrid_extension() {
|
|
1657
|
-
|
|
1658
|
-
|
|
1657
|
+
// gridApi hazırsa api'yi, değilse doğrudan gridOptions'ı günceller
|
|
1658
|
+
const updateRowSelection = (selectionConfig) => {
|
|
1659
|
+
if (this.gridApi) {
|
|
1660
|
+
this.gridApi.setGridOption('rowSelection', selectionConfig);
|
|
1661
|
+
}
|
|
1662
|
+
else {
|
|
1663
|
+
this.gridOptions.rowSelection = selectionConfig;
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1659
1666
|
if (this.allowEdit() == false && this._isPopupValid() == false) {
|
|
1660
1667
|
this.columnDefs().pop();
|
|
1661
1668
|
this.columnDefs().shift();
|
|
1662
1669
|
this.columnDefs().unshift({
|
|
1663
|
-
headerName: '',
|
|
1670
|
+
headerName: '', sortable: true, resizable: true,
|
|
1664
1671
|
filter: true, minWidth: 60, maxWidth: 60, suppressSizeToFit: true, colId: 'editColumn',
|
|
1665
1672
|
cellRenderer: 'buttonRenderer',
|
|
1666
1673
|
cellRendererParams: { label: '1', type: 'edit' },
|
|
1667
1674
|
});
|
|
1668
|
-
|
|
1675
|
+
updateRowSelection({ mode: 'multiRow', checkboxes: true, headerCheckbox: true });
|
|
1669
1676
|
}
|
|
1670
1677
|
if (this._isPopupValid() == true) {
|
|
1671
1678
|
this.columnDefs().pop();
|
|
@@ -1681,14 +1688,14 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1681
1688
|
type: 'popupEdit',
|
|
1682
1689
|
},
|
|
1683
1690
|
});
|
|
1684
|
-
|
|
1691
|
+
updateRowSelection({ mode: 'multiRow', checkboxes: true });
|
|
1685
1692
|
}
|
|
1686
1693
|
else {
|
|
1687
1694
|
this.columnDefs().unshift({
|
|
1688
1695
|
headerName: '', sortable: false, resizable: false, filter: false,
|
|
1689
1696
|
minWidth: 50, maxWidth: 50, suppressSizeToFit: true, cellStyle: { 'padding-top': '5px' }
|
|
1690
1697
|
});
|
|
1691
|
-
|
|
1698
|
+
updateRowSelection({ mode: 'multiRow', checkboxes: true });
|
|
1692
1699
|
}
|
|
1693
1700
|
}
|
|
1694
1701
|
else {
|
|
@@ -1702,7 +1709,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1702
1709
|
type: 'popupEdit',
|
|
1703
1710
|
},
|
|
1704
1711
|
});
|
|
1705
|
-
|
|
1712
|
+
updateRowSelection({ mode: 'singleRow', checkboxes: true });
|
|
1706
1713
|
}
|
|
1707
1714
|
if (this.readOnly()) {
|
|
1708
1715
|
this.columnDefs().unshift({
|
|
@@ -1715,7 +1722,7 @@ class NettyAgGridBase extends NettyAppsBase {
|
|
|
1715
1722
|
type: 'popupSelect',
|
|
1716
1723
|
},
|
|
1717
1724
|
});
|
|
1718
|
-
|
|
1725
|
+
updateRowSelection({ mode: 'singleRow', checkboxes: false });
|
|
1719
1726
|
}
|
|
1720
1727
|
}
|
|
1721
1728
|
}
|
|
@@ -2489,7 +2496,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2489
2496
|
if (this.viewMode() === 'dialog' && this.dialogData) {
|
|
2490
2497
|
return this.dialogData.parameters || '';
|
|
2491
2498
|
}
|
|
2492
|
-
if (this.parameters) {
|
|
2499
|
+
if (this.parameters()) {
|
|
2493
2500
|
try {
|
|
2494
2501
|
return JSON.parse(this.parameters());
|
|
2495
2502
|
}
|
|
@@ -2605,6 +2612,20 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2605
2612
|
error: (err) => this.alertService.showError('@updateFailed', err),
|
|
2606
2613
|
});
|
|
2607
2614
|
}
|
|
2615
|
+
/**
|
|
2616
|
+
* Create new record
|
|
2617
|
+
*/
|
|
2618
|
+
async createNewData() {
|
|
2619
|
+
// If no GUID provided, initialize a new record
|
|
2620
|
+
let newRecord = this.createNewRecord();
|
|
2621
|
+
newRecord = await lastValueFrom(this.nettyAppsProxy.initRecord(newRecord))
|
|
2622
|
+
.catch((er) => {
|
|
2623
|
+
console.error('@initRecordFailed:', er);
|
|
2624
|
+
return this.createNewRecord();
|
|
2625
|
+
});
|
|
2626
|
+
this.initializeFormData(newRecord);
|
|
2627
|
+
this.updateValid.set(true);
|
|
2628
|
+
}
|
|
2608
2629
|
/**
|
|
2609
2630
|
* Load data from API based on GUID
|
|
2610
2631
|
* Handles both new record creation and existing record editing
|
|
@@ -2613,15 +2634,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2613
2634
|
async loadDetailData() {
|
|
2614
2635
|
const guid = this.getGuidFromParameters();
|
|
2615
2636
|
if (!guid) {
|
|
2616
|
-
|
|
2617
|
-
let newRecord = this.createNewRecord();
|
|
2618
|
-
newRecord = await lastValueFrom(this.nettyAppsProxy.initRecord(newRecord))
|
|
2619
|
-
.catch((er) => {
|
|
2620
|
-
console.error('@initRecordFailed:', er);
|
|
2621
|
-
return this.createNewRecord();
|
|
2622
|
-
});
|
|
2623
|
-
this.initializeFormData(newRecord);
|
|
2624
|
-
this.updateValid.set(true);
|
|
2637
|
+
await this.createNewData();
|
|
2625
2638
|
return;
|
|
2626
2639
|
}
|
|
2627
2640
|
// Fetch existing record from API
|