doujia9204 2017-01-04 05:57
浏览 58
已采纳

Sugarcrm禁用在离开之前确认弹出窗口

When there is some changes in the form and if user try to navigate to other page, sugarcrm asks confirmation in a popup to leave.

How to disable this functionality in sugarcrm 7?

Update

Actually i am exporting a csv. The file get downloaded on the first click of the button.

When i click the button for second time it is showing confirmation popup as in in the attachment. enter image description here

  • 写回答

1条回答 默认 最新

  • dougao1106 2017-01-04 06:04
    关注

    comment out everything in CloseActivityPanel function and after commenting your code will be this only as follows:

        closeActivityPanel: {
        show:function(module,id,new_status,viewType,parentContainerId){
            if (SUGAR.util.closeActivityPanel.panel)
       SUGAR.util.closeActivityPanel.panel.destroy();
         var singleModule = SUGAR.language.get("app_list_strings", "moduleListSingular")[module];
         singleModule = typeof(singleModule != 'undefined') ? singleModule.toLowerCase() : '';
         var closeText =  SUGAR.language.get("app_strings", "LBL_CLOSE_ACTIVITY_CONFIRM").replace("#module#",singleModule);
                            var args = "action=save&id=" + id + "&record=" + id + "&status=" + new_status + "&module=" + module;
                            var callback = {
                                success:function(o)
                                {
                                   window.setTimeout(function(){if(document.getElementById('search_form')) document.getElementById('search_form').submit(); else window.location.reload(true);}, 0);
                                },
                                argument:{'parentContainerId':parentContainerId}
                            };
    
                            YAHOO.util.Connect.asyncRequest('POST', 'index.php', callback, args);
        }
    },
    

    This way confirmation pop will not come.

    In case if you wants to disable onbeforeunload then use the following code according to your requirement.

    $(document).on("submit", "form", function(event){
            window.onbeforeunload = null;
    });
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 2024-五一综合模拟赛
  • ¥15 如何将下列的“无限压缩存储器”设计出来
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口