【问题标题】:SuiteCRM, in the calendar under an appointment, the lead in the related area isn't clickableSuiteCRM,在约会下的日历中,相关区域的潜在客户不可点击
【发布时间】:2017-11-01 21:20:53
【问题描述】:

在日历中,将事件分配给特定日期时,有一个名为“相关”的字段。当从下拉列表中选择潜在客户并且我选择从列表中选择时,将打开一个包含所有潜在客户的弹出窗口。

我想要的是在用户从潜在客户列表中选择或更改潜在客户或输入值更改时加载一些自定义 jquery。

到目前为止,我所做的是制作了一个名为 custom.js 的文件,并将其包含在该页面上,并使用以下代码:

$(document).ready(function(){
    $('#parent_name').on('change', function(e){
        alert(1);
    });
});

如果我从键盘向输入框中输入内容,则上述代码有效文件,但如果我从弹出列表中选择选项,则上述代码无效。

请提出正确的方法。

请在下面找到所需的信息:

  • SuiteCRM 版本 7.7.4
  • PHP 版本:5.5

【问题讨论】:

  • 你能显示元素的html吗? (通过用萤火虫或其他东西检查它们)
  • 这是输入字段 HTML:(在 firbug 中)
  • 弹出列表呢?一个不起作用的
  • @Mawcel 我在下面附上了截图。无法在评论部分附加图片。请检查一下。

标签: php jquery sugarcrm suitecrm


【解决方案1】:

如果您检查并看到 “选择” 按钮的 html,那么您将看到以下代码:

onclick="open_popup(document.CalendarEditView.parent_type.value, 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"CalendarEditView","field_to_name_array":{"id":"parent_id","name":"parent_name"}}, "single", true);"

因此,您有以下两种选择:

  1. 创建新的自定义函数:创建新函数并将 onclick 更改为指向您的新函数 (set_return_cstm),如下所示:

onclick="open_popup(document.CalendarEditView.parent_type.value, 600, 400, "", true, false, {"call_back_function":"set_return_cstm","form_name":"CalendarEditView","field_to_name_array":{"id":"parent_id","name":"parent_name"}}, "single", true);"

  1. 覆盖返回callback函数:

    在自定义 js 文件中编写您的函数以覆盖默认函数并在那里执行值分配。研究默认 set_return 函数以获取更多详细信息。以下是帮助代码:

    function set_return (pData){ console.log(" Parent ID = "+pData.name_to_value_array.parent_id); console.log(" Parent Name = "+pData.name_to_value_array.parent_name); }

【讨论】:

  • 谢谢@star。该任务已完成,客户对我提出的解决方案很好,目前记不清了。将尝试为我的自学实施您的解决方案。再次感谢。
  • 是的,请注意,您需要更改此类活动的返回函数。那是糖/套件 CRM 标准。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-11
  • 1970-01-01
  • 2020-10-29
  • 1970-01-01
  • 2014-01-26
  • 1970-01-01
相关资源
最近更新 更多