@xuda.io/runtime-bundle 1.0.686 → 1.0.688

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.
@@ -11843,29 +11843,45 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11843
11843
  const _session = SESSION_OBJ[SESSION_ID];
11844
11844
  const _ds = _session.DS_GLB[fields_changed_datasource];
11845
11845
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
11846
- // const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
11846
+
11847
11847
  validate_change(prog_doc);
11848
11848
  if (found) {
11849
11849
  const $elm = $('#container_5b1_cmp_3700419d8179_0');
11850
+ const elm_data = $elm.data();
11850
11851
  const $wrapper = $elm.parent();
11851
11852
  const wrapper_data = $wrapper.data();
11852
11853
  const refreshed_ds = _ds.dsSession;
11853
- $wrapper.empty();
11854
+
11855
+ let elm_to_delete = [];
11856
+ const ts = Date.now();
11857
+ $.each($elm.find('*'), function (key, val) {
11858
+ let new_id = $(val).attr('xu-ui-id') + ts;
11859
+ elm_to_delete.push(new_id);
11860
+
11861
+ $(val).attr('xu-ui-id', new_id).removeData();
11862
+ });
11863
+
11864
+ // $elm.empty();
11854
11865
  const new_$div = await func.UI.screen.render_ui_tree(
11855
11866
  SESSION_ID,
11856
- $wrapper, // the wrapper
11867
+ $elm, // the wrapper
11857
11868
  _.cloneDeep($elm.data().xuData.node), // the xu-panel node
11858
11869
  {},
11859
- wrapper_data.xuData.paramsP, // the wrapper params
11870
+ elm_data.xuData.paramsP, // the wrapper params
11860
11871
  null,
11861
11872
  null,
11862
- $elm.data().xuData.key, // the wrapper key
11873
+ elm_data.xuData.key, // the wrapper key
11863
11874
  refreshed_ds, // the refreshed_ds
11864
- wrapper_data.xuData.parent_node, // the wrapper parent node
11875
+ elm_data.xuData.parent_node, // the wrapper parent node
11865
11876
  null,
11866
- wrapper_data.xuData.$root_container, // the wrapper root container
11877
+ elm_data.xuData.$root_container, // the wrapper root container
11867
11878
  );
11868
11879
 
11880
+ // remove old screen content
11881
+ $.each(elm_to_delete, async function (key, val) {
11882
+ $("[xu-ui-id='" + elm_to_delete + "']").remove();
11883
+ });
11884
+
11869
11885
  return;
11870
11886
  }
11871
11887
  }
@@ -9565,29 +9565,45 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9565
9565
  const _session = SESSION_OBJ[SESSION_ID];
9566
9566
  const _ds = _session.DS_GLB[fields_changed_datasource];
9567
9567
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
9568
- // const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
9568
+
9569
9569
  validate_change(prog_doc);
9570
9570
  if (found) {
9571
9571
  const $elm = $('#container_5b1_cmp_3700419d8179_0');
9572
+ const elm_data = $elm.data();
9572
9573
  const $wrapper = $elm.parent();
9573
9574
  const wrapper_data = $wrapper.data();
9574
9575
  const refreshed_ds = _ds.dsSession;
9575
- $wrapper.empty();
9576
+
9577
+ let elm_to_delete = [];
9578
+ const ts = Date.now();
9579
+ $.each($elm.find('*'), function (key, val) {
9580
+ let new_id = $(val).attr('xu-ui-id') + ts;
9581
+ elm_to_delete.push(new_id);
9582
+
9583
+ $(val).attr('xu-ui-id', new_id).removeData();
9584
+ });
9585
+
9586
+ // $elm.empty();
9576
9587
  const new_$div = await func.UI.screen.render_ui_tree(
9577
9588
  SESSION_ID,
9578
- $wrapper, // the wrapper
9589
+ $elm, // the wrapper
9579
9590
  _.cloneDeep($elm.data().xuData.node), // the xu-panel node
9580
9591
  {},
9581
- wrapper_data.xuData.paramsP, // the wrapper params
9592
+ elm_data.xuData.paramsP, // the wrapper params
9582
9593
  null,
9583
9594
  null,
9584
- $elm.data().xuData.key, // the wrapper key
9595
+ elm_data.xuData.key, // the wrapper key
9585
9596
  refreshed_ds, // the refreshed_ds
9586
- wrapper_data.xuData.parent_node, // the wrapper parent node
9597
+ elm_data.xuData.parent_node, // the wrapper parent node
9587
9598
  null,
9588
- wrapper_data.xuData.$root_container, // the wrapper root container
9599
+ elm_data.xuData.$root_container, // the wrapper root container
9589
9600
  );
9590
9601
 
9602
+ // remove old screen content
9603
+ $.each(elm_to_delete, async function (key, val) {
9604
+ $("[xu-ui-id='" + elm_to_delete + "']").remove();
9605
+ });
9606
+
9591
9607
  return;
9592
9608
  }
9593
9609
  }