问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/28364493/how-to-add-standard-field-to-custom-layout-of-sugarcrm-7