Last active
August 29, 2015 14:27
-
-
Save dmulvi/fd811589c071bb9f9ba9 to your computer and use it in GitHub Desktop.
create a custom panel-top row action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
extendsFrom: 'PanelTopView', | |
initialize: function(options) { | |
this._super('initialize', [options]); | |
var newEvents = { | |
'click a[name=custom_button]': 'customAction' | |
} | |
_.extend(this.events, newEvents); | |
}, | |
customAction: function() { | |
// do some custom stuff here | |
}, | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$viewdefs['SUBPANEL_MODULE_NAME']['base']['view']['panel-top'] = array( | |
'buttons' => array( | |
array( | |
'type' => 'button', | |
'css_class' => 'btn-invisible', | |
'icon' => 'icon-chevron-up', | |
'tooltip' => 'LBL_TOGGLE_VISIBILITY', | |
), | |
array( | |
'type' => 'actiondropdown', | |
'name' => 'panel_dropdown', | |
'css_class' => 'pull-right', | |
'buttons' => array( | |
array( | |
'type' => 'sticky-rowaction', | |
'icon' => 'icon-plus', | |
'name' => 'create_button', | |
'label' => ' ', | |
'acl_action' => 'create', | |
'tooltip' => 'LBL_CREATE_BUTTON_LABEL', | |
), | |
// THIS IS THE CUSTOM ADDITION | |
array( | |
'type' => 'rowaction', | |
'name' => 'custom_button', | |
'label' => ' Do Custom Stuff', | |
'css_class' => 'btn', | |
'icon' => 'icon-thumbs-up', | |
), | |
// END CUSTOM ADDITION | |
), | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment