Open veso266 opened 5 years ago
for anyone figuring out the same thing, you use templates, you need to change container-array-actionbar
so put this into your view
{
"parent":"bootstrap-edit",
"templates":{
"container-array-actionbar":"youtemplate.html"
}
}
and put this into your template
<script type="text/x-handlebars-template" id="action=">
<div class="alpaca-array-actionbar alpaca-array-actionbar-{{actionbarStyle}} btn-group" data-alpaca-array-actionbar-parent-field-id="{{parentFieldId}}" data-alpaca-array-actionbar-field-id="{{fieldId}}" data-alpaca-array-actionbar-item-index="{{itemIndex}}">
{{#each actions}}
<button class="alpaca-array-actionbar-action {{#if this.buttonClass}} {{this.buttonClass}} {{else}}{{../view.styles.smallButton}}{{/if}}" data-alpaca-array-actionbar-action="{{action}}">
{{#if this.iconClass}}
<i class="{{this.iconClass}}"></i>
{{/if}}
{{#if label}}{{{label}}}{{/if}}
</button>
{{/each}}
</div>
</script>
in your template you use Handlebars to create if and else and so on
so now you can use buttonClass
to style your button
so this should work now 😄
'actionbar' => array (
'showLabels' => true,
'actions' => array (
0 =>
array (
'label' => ' ',
"buttonClass" => 'btn btn-primary btn-large', //I would like to change this from btn btn btn-secondary to btn btn-primary
"iconClass" => "far fa-plus",
'action' => 'add',
),
now if buttonClass
could make in into master branch that would be great 😄 cuz I realy don't want to use templates to style many different buttons
Hi is it possible to change this buttons
is this possible without using templates maybe adding buttonClass where I could change which button is shown, or tell me which template I need to change to add buttonClass to my own template?
Thanks for Anwsering and Best Regards