ci-nested-sets icon indicating copy to clipboard operation
ci-nested-sets copied to clipboard

how can i move two main nodes that have no targets ?

Open khashabawy opened this issue 12 years ago • 1 comments

In the attached file how can i move Plastics and Electronics :

untitled

for moving any other sub nodes i do this :

        $cat = $this->nested_set->getNodeFromId($cat_id);

        if($cat["cat_parent_id"]){

            $parent = $this->nested_set->getNodeFromId($cat["cat_parent_id"]);

            if($direction == "up"){                            
                $this->nested_set->setNodeAsFirstChild($cat , $parent);
            }else{                
                $this->nested_set->setNodeAsLastChild($cat , $parent);
            }       
        }

I there any way to :

1- move nodes by one step ( not as first child or last child ) ? 2- move main nodes that have no targets (parents) ?

khashabawy avatar Nov 11 '13 16:11 khashabawy

use setNodeAsNextSibling or setNodeAsPrevSibling it works for me

quasiperfect avatar Sep 10 '14 11:09 quasiperfect