Tuesday, November 4, 2008

Re: tree behavior sorting

Here is a tutorial I wrote a while ago that does what you describe.
I've only used it with <= RC2 so not sure if it will work with RC3,
but I'm guessing (hoping!) it does.

http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/

I did run into a few bugs when I was playing with the tree behavior,
but I think they have all been fixed.

Cheers,
Adam

On Nov 4, 3:59 am, adriaanb <adriaanb.br...@gmail.com> wrote:
> Hey guys,
>
> I am using the tree behavior (first time) and got a question about
> sorting.
>
> I am using it for a multilevel menu system with drag&drop sortables.
>
> Everything works very nicely, but can't figure one thing out. When I
> sort items on the same level the parent_id doesn't change and the tree
> structure doesn't get updated.
>
> The solution I use now, is by setting the parent_id to NULL and back
> again. See below.
>
> $this->MenuItem->saveField('parent_id', 'NULL', false);
> $this->MenuItem->saveField('parent_id', $parentId, false);
>
> Is this the way to bypass this behaviour or are there better ways to
> do this?
>
> Thanks,
> Adriaan
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: