@xuda.io/runtime-bundle 1.0.1388 → 1.0.1389

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.
@@ -34810,53 +34810,57 @@ func.UI.screen.panel_post_render_handler = async function (
34810
34810
  $panel_div, // the panel div
34811
34811
  jobNoP,
34812
34812
  ) {
34813
- const _container_ds = SESSION_OBJ[SESSION_ID].DS_GLB[$container.data().xuData.paramsP.dsSessionP];
34814
- const _ds = SESSION_OBJ[SESSION_ID].DS_GLB[$wrapper.data().xuData.paramsP.dsSessionP];
34815
- const find_old_panels_elements = function () {
34816
- return func.UI.utils.find_in_element_data('xuPanelData', $container.parent(), 'xu-ui-id', $container.data()?.xuPanelData?.xu_panel_xu_ui_id);
34817
- };
34818
- var $old_panel_div = find_old_panels_elements();
34819
- const set_xuPanelData_to_the_new_rendered_items = () => {
34820
- $container.data().xuPanelWrapper = { isWrapper: true, panelXuAttributes: _.clone($wrapper.data().xuAttributes), panelDivData: _.clone($wrapper.data()) };
34821
- $container.attr('xu-panel-wrapper-id', $wrapper.attr('xu-ui-id'));
34822
- $.each($wrapper.children(), function (key, val) {
34823
- if (!$(val).data().xuPanelData) {
34824
- $(val).data().xuPanelData = {};
34825
- }
34826
- $(val).data().xuPanelData.parent_element_ui_id = $old_panel_div?.length ? $container.parent().data().xuData.ui_id : $container.data().xuData.ui_id;
34827
-
34828
- $(val).data().xuPanelData.xu_panel_xu_ui_id = (nodeP.xu_tree_id || nodeP.id) + '-' + _container_ds?.currentRecordId;
34829
- $(val).data().xuPanelData.node = nodeP;
34830
- $(val).data().xuPanelData.$panel_div = $panel_div.clone(true);
34831
- });
34832
- };
34833
- set_xuPanelData_to_the_new_rendered_items();
34813
+ try {
34814
+ const _container_ds = SESSION_OBJ[SESSION_ID].DS_GLB[$container.data().xuData.paramsP.dsSessionP];
34815
+ const _ds = SESSION_OBJ[SESSION_ID].DS_GLB[$wrapper.data().xuData.paramsP.dsSessionP];
34816
+ const find_old_panels_elements = function () {
34817
+ return func.UI.utils.find_in_element_data('xuPanelData', $container.parent(), 'xu-ui-id', $container.data()?.xuPanelData?.xu_panel_xu_ui_id);
34818
+ };
34819
+ var $old_panel_div = find_old_panels_elements();
34820
+ const set_xuPanelData_to_the_new_rendered_items = () => {
34821
+ $container.data().xuPanelWrapper = { isWrapper: true, panelXuAttributes: _.clone($wrapper.data().xuAttributes), panelDivData: _.clone($wrapper.data()) };
34822
+ $container.attr('xu-panel-wrapper-id', $wrapper.attr('xu-ui-id'));
34823
+ $.each($wrapper.children(), function (key, val) {
34824
+ if (!$(val).data().xuPanelData) {
34825
+ $(val).data().xuPanelData = {};
34826
+ }
34827
+ $(val).data().xuPanelData.parent_element_ui_id = $old_panel_div?.length ? $container.parent().data().xuData.ui_id : $container.data().xuData.ui_id;
34828
+
34829
+ $(val).data().xuPanelData.xu_panel_xu_ui_id = (nodeP.xu_tree_id || nodeP.id) + '-' + _container_ds?.currentRecordId;
34830
+ $(val).data().xuPanelData.node = nodeP;
34831
+ $(val).data().xuPanelData.$panel_div = $panel_div.clone(true);
34832
+ });
34833
+ };
34834
+ set_xuPanelData_to_the_new_rendered_items();
34834
34835
 
34835
- if ($old_panel_div?.length) {
34836
- $($old_panel_div[0]).after($wrapper.children());
34837
- } else {
34838
- $.each($wrapper.children(), function (key, child) {
34839
- $.each($container.children(), function (key, elm) {
34840
- if ($(elm)?.data()?.xuData && $(elm)?.data()?.xuData?.elem_key === $(child)?.data()?.xuData?.elem_key) {
34841
- $(elm).remove();
34842
- }
34836
+ if ($old_panel_div?.length) {
34837
+ $($old_panel_div[0]).after($wrapper.children());
34838
+ } else {
34839
+ $.each($wrapper.children(), function (key, child) {
34840
+ $.each($container.children(), function (key, elm) {
34841
+ if ($(elm)?.data()?.xuData && $(elm)?.data()?.xuData?.elem_key === $(child)?.data()?.xuData?.elem_key) {
34842
+ $(elm).remove();
34843
+ }
34844
+ });
34845
+ $container.append($(child));
34843
34846
  });
34844
- $container.append($(child));
34845
- });
34846
- }
34847
+ }
34847
34848
 
34848
- if (!$wrapper.data()?.xuData?.dsSession) return;
34849
+ if (!$wrapper.data()?.xuData?.dsSession) return;
34849
34850
 
34850
- if ($old_panel_div?.length) {
34851
- $container.parent().data().xuData.paramsP.dsSessionP = _ds.parentDataSourceNo; // set the new ds when panel replaced
34852
- } else {
34853
- $container.data().xuData.paramsP.dsSessionP = _ds.parentDataSourceNo; // set the new ds when panel replaced
34854
- }
34851
+ if ($old_panel_div?.length) {
34852
+ $container.parent().data().xuData.paramsP.dsSessionP = _ds.parentDataSourceNo; // set the new ds when panel replaced
34853
+ } else {
34854
+ $container.data().xuData.paramsP.dsSessionP = _ds.parentDataSourceNo; // set the new ds when panel replaced
34855
+ }
34855
34856
 
34856
- if ($old_panel_div?.length) {
34857
- $old_panel_div.remove();
34857
+ if ($old_panel_div?.length) {
34858
+ $old_panel_div.remove();
34859
+ }
34860
+ return jobNoP;
34861
+ } catch (error) {
34862
+ return jobNoP;
34858
34863
  }
34859
- return jobNoP;
34860
34864
  };
34861
34865
 
34862
34866
  // const generate_xu_ui_id = async function (SESSION_ID, nodeP, $container, paramsP, keyP) {