here is my code for the view using the ajax helper (note the ids are
important, these are actually the ids that exist in the database)

<ul id="items">
        <li id="item_1">Item 1</li>
        <li id="item_2">Item 2</li>
        <li id="item_3">Item 3</li>
</ul>

<?php echo $ajax->sortable('items', array('constraint' => false,
'url'=>'/myitems/updaterank/')); ?>



and now the code in the myitems controller:

function updaterank()
{
        foreach ($this->params['form']['items'] as $rank => $id){
                $this->MyItem->id = $id;
                $this->MyItem->saveField('rank',$rank);
        }
        $this->autoRender = false;
}



Cheers,
Adam


On Dec 6, 4:19 am, luke BAKING barker <[EMAIL PROTECTED]> wrote:
> Hi
>
> I am building a little menu manager for a backend of a site. I am
> using this Nestable Sortable drag and drop script , using mootools
> framework.
> demo and script:http://youmuppet.com/?page_id=9
> description:http://forum.mootools.net/viewtopic.php?id=1106
>
> It essentially allows the reordering of a <OL>'s <LI>'s and nested
> <OL>s , and does it very nciely.
>
> I want to allow the user to re-order the list as they want the "tree"
> to be, then hit a Submit button, which will post this and update all
> the items in the database with their new order. I know this involves
> serializing the data, but am asking for a few pointers on finding out
> how to do this, with particular reference to the most Cake way(s) of
> doing this?
>
> I havent any experience really with AJAX in CakePHP, and didnt want to
> steam ahead and miss out any of the goodness there may be!
>
> thanks for any help you may be able to give,
>
> Luke
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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