@xuda.io/runtime-bundle 1.0.463 → 1.0.465

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.
@@ -2588,7 +2588,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2588
2588
  break;
2589
2589
  }
2590
2590
  case 'component': {
2591
- debugger;
2592
2591
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
2593
2592
  _ds.rows_processed = 0;
2594
2593
  _ds.viewRangeExp_rows_deleted = 0;
@@ -2606,10 +2605,33 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2606
2605
  }
2607
2606
 
2608
2607
  const row_not_found = async function () {
2609
- if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2608
+ // if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2609
+ // _ds.currentRecordId = 'newRecord';
2610
+ // _ds.set_mode = 'C';
2611
+ // _ds.record_not_found = true;
2612
+
2613
+ // try {
2614
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
2615
+ // } catch (error) {
2616
+ // await func.datasource.render_fields_form(SESSION_ID, dataSourceSession, { id: 'newRecord', value: {} });
2617
+ // }
2618
+
2619
+ // var count = await func.datasource.get_field_init_count(SESSION_ID, dataSourceSession, 'newRecord', false);
2620
+ // if (
2621
+ // count > 0 // was: && !args.dataSourceNoP
2622
+ // ) {
2623
+ // await func.datasource.execute_field_init_events(SESSION_ID, dataSourceSession, 'form', 'newRecord');
2624
+ // }
2625
+ // }
2626
+
2627
+ if (!prog_obj.progDataSource?.dataSourceType || prog_obj.properties.renderType === 'form' || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2610
2628
  _ds.currentRecordId = 'newRecord';
2611
- _ds.set_mode = 'C';
2612
- _ds.record_not_found = true;
2629
+ if (tree_obj.rwMode === 'U' && tree_obj.allowCreate) {
2630
+ _ds.set_mode = 'C';
2631
+ }
2632
+ if (prog_obj.progDataSource?.dataSourceType) {
2633
+ _ds.record_not_found = true;
2634
+ }
2613
2635
 
2614
2636
  try {
2615
2637
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
@@ -2624,6 +2646,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2624
2646
  await func.datasource.execute_field_init_events(SESSION_ID, dataSourceSession, 'form', 'newRecord');
2625
2647
  }
2626
2648
  }
2649
+
2627
2650
  await func.datasource.callback(SESSION_ID, dataSourceSession, args.rowIdP, args.jobNoP, _ds.prog_id);
2628
2651
  };
2629
2652
  if (!rows) {
@@ -2588,7 +2588,6 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2588
2588
  break;
2589
2589
  }
2590
2590
  case 'component': {
2591
- debugger;
2592
2591
  _raw_data_rows = _ds?.v.raw_data?.rows || [];
2593
2592
  _ds.rows_processed = 0;
2594
2593
  _ds.viewRangeExp_rows_deleted = 0;
@@ -2606,10 +2605,33 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2606
2605
  }
2607
2606
 
2608
2607
  const row_not_found = async function () {
2609
- if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2608
+ // if (!prog_obj.progDataSource?.dataSourceType || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2609
+ // _ds.currentRecordId = 'newRecord';
2610
+ // _ds.set_mode = 'C';
2611
+ // _ds.record_not_found = true;
2612
+
2613
+ // try {
2614
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
2615
+ // } catch (error) {
2616
+ // await func.datasource.render_fields_form(SESSION_ID, dataSourceSession, { id: 'newRecord', value: {} });
2617
+ // }
2618
+
2619
+ // var count = await func.datasource.get_field_init_count(SESSION_ID, dataSourceSession, 'newRecord', false);
2620
+ // if (
2621
+ // count > 0 // was: && !args.dataSourceNoP
2622
+ // ) {
2623
+ // await func.datasource.execute_field_init_events(SESSION_ID, dataSourceSession, 'form', 'newRecord');
2624
+ // }
2625
+ // }
2626
+
2627
+ if (!prog_obj.progDataSource?.dataSourceType || prog_obj.properties.renderType === 'form' || (tree_obj.rwMode === 'U' && tree_obj.allowCreate)) {
2610
2628
  _ds.currentRecordId = 'newRecord';
2611
- _ds.set_mode = 'C';
2612
- _ds.record_not_found = true;
2629
+ if (tree_obj.rwMode === 'U' && tree_obj.allowCreate) {
2630
+ _ds.set_mode = 'C';
2631
+ }
2632
+ if (prog_obj.progDataSource?.dataSourceType) {
2633
+ _ds.record_not_found = true;
2634
+ }
2613
2635
 
2614
2636
  try {
2615
2637
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
@@ -2624,6 +2646,7 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2624
2646
  await func.datasource.execute_field_init_events(SESSION_ID, dataSourceSession, 'form', 'newRecord');
2625
2647
  }
2626
2648
  }
2649
+
2627
2650
  await func.datasource.callback(SESSION_ID, dataSourceSession, args.rowIdP, args.jobNoP, _ds.prog_id);
2628
2651
  };
2629
2652
  if (!rows) {