Hi,
If I use Relation manager, is this able to handle reorder behaviour like drag&drop
Thank you,
Zs
Hi,
If I use Relation manager, is this able to handle reorder behaviour like drag&drop
Thank you,
Zs
Yes it can.
Seeing your screenshot, let’s say you have two models :
Make sure in author_plugin_supportingdetails, you have two fields; supporting_id and sort_order.
In your model SupportingDetail, add inside the class:
use \October\Rain\Database\Traits\Sortable;
In your relation_config.yaml of your Supporting controller, update it and add the structure section:
supportingdetails:
label: ...
view:
list: ...
toolbarButtons: ...
recordsPerPage: ...
manage:
form: ...
structure:
showReorder: true
showTree: false
@ngyzsolt Add the filter into the view configuration.
supportingdetails:
label: ...
view:
list: ...
toolbarButtons: ...
recordsPerPage: ...
filter: $/authorname/plugin/models/supportingdetail/scopes.yaml
manage:
form: ...
structure:
showReorder: true
showTree: false
and in $/authorname/plugin/models/supportingdetail/scopes.yaml, something like:
scopes:
category:
label: Category
modelClass: Acme\Blog\Models\Category
conditions: category_id in (:value)
nameFrom: name
Unfortunatelly does not render the filter, in relation controller. And I do not got any errors.
You can render filters in relation controller, i’ve done it in many projects.
Download the test plugin and find what you need.
php artisan plugin:install October.Test --from=https://github.com/octobercms/test-plugin
Thank you for you help. It is working!