yiiext / nested-set-behavior

AR models behavior that allows to work with nested sets tree.
http://www.yiiframework.com/extension/nestedsetbehavior/
BSD 3-Clause "New" or "Revised" License
157 stars 64 forks source link

How to modify the order of the tree? #30

Closed djfly closed 10 years ago

djfly commented 10 years ago
- 1. Mobile phones
    - 2. iPhone
    - 3. Samsung
        - 4. X100
        - 5. C200
    - 6. Motorola
- 7. Cars
    - 8. Audi
    - 9. Ford
    - 10. Mercedes

I want to change like this

- 7. Cars
    - 8. Audi
    - 9. Ford
    - 10. Mercedes
- 1. Mobile phones
    - 2. iPhone
    - 3. Samsung
        - 4. X100
        - 5. C200
    - 6. Motorola

but moveAfter moveBefore no support target node is root

kosenka commented 10 years ago

Да, а как изменить порядок веток?

liff4 commented 10 years ago

Бери отсюда https://github.com/liff4you/nested-set-behavior, т.к тут на пулы ложили, только надо определить public $orderAttribute='order';

Это для сортировки корней в hasManyRoot режиме

kosenka commented 10 years ago

Спасибо, попробую

creocoder commented 10 years ago

You can't modify root order. To solve your trouble just use extension in hasManyRoots = false mode where you have one root and Car and Mobile phones is nodes.