Brian Granger a écrit :

> Hi there,
>
> I am using MochiKit to develop a web-based frontend for a
> Twisted/Python Servers.  Coming from the Twisted/Python/OjbC world, I
> am really enjoying MochiKit.  I have a question about Sortables.
>
> Is it possible to nest sortables?  I have a layout that consists of
> nested divs:
>
>         <div id='dnd1'>
>             <div id='dnd2'>
>                 <div>stuff</div>
>                 <div>morestufff</div>
>             </div>
>             <div id='dnd3'>
>                 <div>stuff</div>
>                 <div>morestufff</div>
>             </div>
>         </div>
>
>         <script type="text/javascript">
>             MochiKit.Sortable.Sortable.create('dnd1',{ 'tag':'div'});
>             MochiKit.Sortable.Sortable.create('dnd2',{ 'tag':'div'});
>             MochiKit.Sortable.Sortable.create('dnd3',{'tag':'div'});
>         </script>
>
> I would like to be able have the inner most div's be sortable _and_ the
> outer divs to be sortable as well.  Is this possible?

Yes it's possible, even though not really the main point of Sortable.
The only thing you need is something where the user can click to drag
your sortable:

        <div id='dnd1'>
            <div id='dnd2'>foo
                <div>stuff</div>
                <div>morestufff</div>
            </div>
            <div id='dnd3'>bar
                <div>stuff</div>
                <div>morestufff</div>
            </div>
        </div>

With this, 'foo' and 'bar' will move 'dnd-2' and 'dnd-3' with all their
children inside dnd-1.

>  I did see that
> in Sortable.js, there was an unimplemented tree option.  Does this mean
> that this type of thing might be possible.  Any thoughts on how to go
> about this?

It's another functionnality comin from Scriptaculous 1.6. It should not
too complicated too import, I'll try it soon.

-- 
Thomas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to