Skip to content

Instantly share code, notes, and snippets.

@maranemil
Created June 12, 2015 10:29
Show Gist options
  • Save maranemil/18836d6559a386a41ee6 to your computer and use it in GitHub Desktop.
Save maranemil/18836d6559a386a41ee6 to your computer and use it in GitHub Desktop.
SugarCRM7 Add custom action button and custom view with drawer
Step 1. Create Custom Layout in:
custom/modules/<YourModule>/clients/base/layouts/<YourLayout>/<YourLayout>.php
Define YourLayout
and define $viewdefs['YourModule']['base']['layout']['YourLayout'] ....
...
'components' =>
array(
array(
'view' => 'YourView',
),
),
-------------------------------------------------------------------
Step 2. Create custom view:
custom/modules/YourModule/clients/base/views/YourView/YourView.hbs
custom/modules/YourModule/clients/base/views/YourView/YourView.php
Define YourView php and hbs:
$viewdefs['YourModule']['base']['views']['YourView'] ...
---------------------------------------------------------------------
Step 3. Create a button and call a drawer from extended Recorview as:
extendsFrom: 'StickyRowactionField', ....
custom/modules/YourModule/clients/base/fields/YourLinkAction/YourLinkAction.js
...
app.drawer.open({
layout: 'YourLayout',
context: {
create: true,
}
});
tutorial create-action
http://www.insightful.com.au/sugarcrm-how-do-i/creating-custom-button-sugar-7/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment