如何将标准字段添加到 SugarCRM 7 的自定义布局 [英] How to add standard field to custom layout of SugarCRM 7

查看:28
本文介绍了如何将标准字段添加到 SugarCRM 7 的自定义布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为自定义模块创建向导.在 https://www.sugaroutfitters.com/blog/creating-a-layout-and-view-for-a-module-in-sugarcrm-7

我创建自定义布局,

 $viewdefs['mymodulename']['base']['layout']['wizard'] = array('类型' =>'简单的','组件' =>大批(大批('视图' =>'巫师',),),);

hbs 模板

 {{>向导.header }}<div class="tcenter">第1步<br/><br/><button class="previousStep btn btn-success">Previous</button><button class="nextStep btn btn-success">Next</button>

{{>向导.footer }}"

和控制器:

 ({className: 'mymodulename-wizard...

是否可以通过使用元数据或其他方式在此自定义布局(例如在标准记录视图中)添加和使用标准 SugarCRM 字段(下拉菜单、日历、货币、相关字段等)?或者一定需要在我的自定义 hbs 模板中创建自定义控件?

解决方案

是的,您可以,但您需要使用模板中的 {{field}} Handlebars 助手来插入它们.

要查看如何使用字段助手的示例,请参阅 Sugar 7.5 中的 dashablelist.hbspreview.hbs.

I need create wizard for custom module. It was easy by using example at https://www.sugaroutfitters.com/blog/creating-a-layout-and-view-for-a-module-in-sugarcrm-7

I create custom layout,

    $viewdefs['mymodulename']['base']['layout']['wizard'] = array(
    'type' => 'simple',
    'components' =>
    array(
        array(
            'view' => 'wizard',
        ),
    ),
);

hbs-template

    {{> wizard.header }}
<div class="tcenter">
    Step 1
    <br/><br/>
    <button class="previousStep btn btn-success">Previous</button>
    <button class="nextStep btn btn-success">Next</button>
</div>
{{> wizard.footer }}"

and controller:

    ({
    className: 'mymodulename-wizard     
...

Is it possible to add and use standard SugarCRM fields (dropdown, calendar, currency, relate field etc.) on this custom layout, like in standard record view, by using metadata or as otherwise? Or necessarily need to create custom controls in my custom hbs-template?

解决方案

Yes, you can though you will need to use the {{field}} Handlebars helper in your template to insert them.

To see examples of how to use field helper see dashablelist.hbs or preview.hbs in Sugar 7.5.

这篇关于如何将标准字段添加到 SugarCRM 7 的自定义布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆