@nettyapps/ntybase 21.1.18 → 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.
|
@@ -2496,7 +2496,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2496
2496
|
if (this.viewMode() === 'dialog' && this.dialogData) {
|
|
2497
2497
|
return this.dialogData.parameters || '';
|
|
2498
2498
|
}
|
|
2499
|
-
if (this.parameters) {
|
|
2499
|
+
if (this.parameters()) {
|
|
2500
2500
|
try {
|
|
2501
2501
|
return JSON.parse(this.parameters());
|
|
2502
2502
|
}
|
|
@@ -2612,6 +2612,20 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2612
2612
|
error: (err) => this.alertService.showError('@updateFailed', err),
|
|
2613
2613
|
});
|
|
2614
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
|
+
}
|
|
2615
2629
|
/**
|
|
2616
2630
|
* Load data from API based on GUID
|
|
2617
2631
|
* Handles both new record creation and existing record editing
|
|
@@ -2620,15 +2634,7 @@ class NettyAgGridSaveBase extends NettyAppsBase {
|
|
|
2620
2634
|
async loadDetailData() {
|
|
2621
2635
|
const guid = this.getGuidFromParameters();
|
|
2622
2636
|
if (!guid) {
|
|
2623
|
-
|
|
2624
|
-
let newRecord = this.createNewRecord();
|
|
2625
|
-
newRecord = await lastValueFrom(this.nettyAppsProxy.initRecord(newRecord))
|
|
2626
|
-
.catch((er) => {
|
|
2627
|
-
console.error('@initRecordFailed:', er);
|
|
2628
|
-
return this.createNewRecord();
|
|
2629
|
-
});
|
|
2630
|
-
this.initializeFormData(newRecord);
|
|
2631
|
-
this.updateValid.set(true);
|
|
2637
|
+
await this.createNewData();
|
|
2632
2638
|
return;
|
|
2633
2639
|
}
|
|
2634
2640
|
// Fetch existing record from API
|