Select2 in list #636
-
I want to add a select2 field in list's bottom, for example i coud add a button to bottom of my list with: how can i do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @soluzione-software . I'd suggest you create a custom button https://backpackforlaravel.com/docs/6.x/crud-buttons#creating-a-custom-button-1 In that view you can have the select, the button and the JS (if needed) to control the select/button behavior. There is no stock option built in Backpack for that, sorry. Cheers 🙏 |
Beta Was this translation helpful? Give feedback.
-
ok I solve. |
Beta Was this translation helpful? Give feedback.
ok I solve.
simply in view:
$field=[ // select_from_array
'name' => 'template',
'label' => "Template",
'type' => 'select_from_array',
'options' => ['one' => 'One', 'two' => 'Two'],
'allows_null' => false,
'default' => 'one',
// 'allows_multiple' => true, // OPTIONAL; needs you to cast this to array in your model;
];
@include('crud::fields.'.$field['type'], array('field' => $field))