dongxiong1935 2015-09-16 10:04 采纳率: 0%
浏览 67
已采纳

在SugarCRM中添加自定义分组字段

I need to create a custom field Contact in Sugar CRM.

The field will contain 2 inputs and one select box. And the whole thing should be replicated upon clicking the Add button.

I'm new to Sugar CRM and wondering if I can add the field.

Every comment or answer will appreciate. Thanks in advance.


This is the field that I need to add

<img src="https://imageshack.com/i/id92zCAAp" border="0">

</div>
  • 写回答

1条回答 默认 最新

  • doudun1934 2015-09-18 05:08
    关注

    sorry i will paste the code here, so it can be formatted nicely.

    I did it like this, In my editviewdefs file i added a custom field with the following definition :

    array (
            'name' => 'status_info_fieldset_c',
            'label' => 'LBL_STATUS_INFO_FIELDSET',
            'customCode' => '<fieldset id = "statInfoFieldSet">
                                <legend>Status Information</legend>
                            </fieldset>',
          ),
    

    I override the field and added a customCode, this is the container of the fields.

    To group the fields i use js to modify the DOM elements specifically changing the position of the elements like this ,

    // Copy stat info buttons to fieldset
        var statInfoBtnTdParentOld = $('#changeStatusBtn').parent().prev();
        var statInfoBtnTdOld = $('#changeStatusBtn').parent();
        var statInfoBtnTdParent = statInfoBtnTdParentOld.clone();
        var statInfoBtnTd = statInfoBtnTdOld.clone();
        var statInfoBtnTr = $('<tr></tr>');
        statInfoBtnTr.append(statInfoBtnTdParent);
        statInfoBtnTr.append(statInfoBtnTd);
        statInfoBtnTdParentOld.parent().remove();
    

    It depends on how u do it, but I just moved the elements inside the container.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?