thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

BREAD Reorder #4641

Open decolife opened 4 years ago

decolife commented 4 years ago

Version information

Description of problem

I need reorder any BREAD with childs. Now we have button #order, but i need reorder elements with childs! In Backpack we can do it. We just need to add parent_id, lft, rgt and depth columns in our table and we got REORDER with childs. I have big problems now, coz my lovely Voyager do not have REORDER with CHILDS REORDER. I have 400 page in my website. I just want to have 400 rows in my table and have parent_it, lft, rgt, depth fields. And simple functionality as Backpack with Reorder any level!

rs

This is NOT menu reorder with childs we need. Resource (database table with rows) reorder with childs need.

I dont' want any feature, but i need this! Is most grate feature what we need! We need to get tree of all resources in our BREAD - just 4 fields (parent_id, lft, rgt, depth).

Please guys make me happy! Please! I love Voyager. But I have biggest minus with it.

MrCrayon commented 4 years ago

Extend order view

@extends('voyager::bread.order')

@section('javascript')
    @parent

    <script>
        $('document').ready(function () {
            $('.dd').nestable('destroy');
            $('.dd').nestable({
                maxDepth: 3
            });
        });
    </script>
@stop

Then you'll need to extend VoyagerBaseController order method for the saving part. Have fun!

Edit: forgot @parent and use destroy.

dzianisyaukhuta commented 4 years ago

Extend order view

@extends('voyager::bread.order')

@section('javascript')
    @parent

    <script>
        $('document').ready(function () {
            $('.dd').nestable('destroy');
            $('.dd').nestable({
                maxDepth: 3
            });
        });
    </script>
@stop

Then you'll need to extend VoyagerBaseController order method for the saving part. Have fun!

Edit: forgot @parent and use destroy.

Thank you for small start. ; ) Okay, I am working on it now. Voyager need to have reorder with childrens in any BREAD object.
I will let you know when it will be ready...

dzianisyaukhuta commented 4 years ago

All is ready. I’ll check for various bugs, prepare a pull request and send it for approval.

dzianisyaukhuta commented 4 years ago

All is ready.

sortt

Sent pull request here: https://github.com/the-control-group/voyager/pull/4671