Nope sorry - I haven't any points during which I'd need to reorder a
tree, and I'm struggling to think of where I'd need do it.

On Jul 8, 1:02 pm, DragonFlyEye <dragonflyey...@gmail.com> wrote:
> Bump. Does anyone out there have any experience with this?
>
> On Jul 7, 9:04 am, DragonFlyEye <dragonflyey...@gmail.com> wrote:
>
>
>
> > Better formatting for my function:
> > public function admin_save() {
> >     $this->layout                = 'ajax';
> >     $this->autoLayout    = false;
> >     $this->autoRender    = false;
>
> >     if(empty($this->data)) :
> >        $response = array('No input.');
> >     else :
> >        $response = 
> > $this->NavigationNode->saveAll($this->data['NavigationNode'], 
> > array('validate' => 'first', 'fieldList' =>
>
> > array('line', 'node_id')));
> >        if($response) :
> >           $this->NavigationNode->reorder(array('field' => 'line',
> > 'order' => 'DESC'));
> >        endif;
> >    endif;
> >    $this->header('Content-Type: application/json');
> >    echo json_encode($response);
> >    return;
>
> > }
>
> > On Jul 7, 8:08 am, DragonFlyEye <dragonflyey...@gmail.com> wrote:
>
> > > The CakePHP documentation has zero information on this function. The
> > > API has very little more. I've looked at the code, but am not sure I
> > > fully understand what it's supposed to be doing.
>
> > > I was under the impression that I could pass reorder() a field out of
> > > the table and it would alter the lft and rght so that the next query
> > > to children() would be in the same order as that field, but while I've
> > > got the function seemingly working (finishing my AJAX call is taking a
> > > lot longer than it did without the call, I presume it's doing
> > > something), I don't see any change to my data. I tried using this
> > > thread to figure how to make everything work right, but I'm just not
> > > seeing any 
> > > changes:http://groups.google.com/group/cake-php/browse_thread/thread/b782b5a3...
>
> > > Here's my code:
>
> > >         public function admin_save() {
> > >                 $this->layout                = 'ajax';
> > >                 $this->autoLayout    = false;
> > >                 $this->autoRender    = false;
>
> > >                 if(empty($this->data)) :
> > >                         $response = array('No input.');
> > >                 else :
> > >                         $response = 
> > > $this->NavigationNode->saveAll($this->data['NavigationNode'], 
> > > array('validate'    => 'first',
>
> > >                                                                           
> > >                                                                           
> > >                                     'fieldList'     => array('line', 
> > > 'node_id')));
> > >                         if($response) :
> > >                                 
> > > $this->NavigationNode->reorder(array('field' => 'line', 'order' =>
> > > 'DESC'));
> > >                         endif;
> > >                 endif;
> > >                 $this->header('Content-Type: application/json');
> > >                 echo json_encode($response);
> > >                 return;
> > >         }
>
> > > "line" is the field that specifies the order of items in a given
> > > node's children.
>
> > > Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to