I'm having a strange issue with the Tree behavior method, reorder().

If I do this it works:

function order() {
        $this->Page->reorder(array('field' => 'Page.order', 'order' =>
'ASC'));
}

But if I do this, it won't reorder the tree:

function order() {
        $this->data = array();
        foreach($this->params['form']['rows_list'] as $order => $id) {
                $this->data[] = array('id' => $id, 'order' => $order);
        }
        $this->Page->saveAll($this->data);

        $this->Page->reorder(array('field' => 'Page.order', 'order' =>
'ASC'));
}

I know the saving of my order fields is working because I can do the
saveAll, edit the function putting the reorder() call first, then call
the function again and it will reorder it properly. The order()
function here is being called by Ajax. Anyone have a clue?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to