[Seaside] jQueryUI Drago & Drop

Antoine Cervoise cervoise at gmail.com
Thu Apr 22 21:16:30 UTC 2010


I'm using Seaside 3.0a5 and I've importe jQuery and jQueryUI

I'm trying to do a drag & drop effect like here :

but there is some information missing. I can move my elements, I detect when
there are on the draggable zone but I don't find the method for adding my
element wich I am dropping in the draggable zone. On seaside website they
use a callbackDroppable method but I do not have it.

I'm doing this :

WAComponent subclass: #Test2
    instanceVariableNames: 'selected'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'visuel'

Test2>>renderContentOn: html
    self dragzone:html .
    self dropzone:html.

Test2>>dragzone: html
    | maListe |
    maListe := Set new .
    maListe add: Composant new . "here Composant is juste a string"
     html div class: 'inventory ui-corner-all drag'; with: [ maListe do: [
:each | html div
         with: each] ] .

Test2>>dropzone: html
html div
      class: 'ui-droppable ui-corner-all drop';
    script: (html jQuery new droppable
         onDrop: (html jQuery ajax callback:
                                            [ :event | self selected add:
(event at: #draggable)  ] ;
                                        html: [ :r | self
renderSelectedItemsOn: r ]));
      with: [ self renderSelectedItemsOn: html ]

Test2>>renderSelectedItemsOn: html
     self selected do: [ :each |
      html div
         class: each;
         passenger: each;
         script: (html jQuery new draggable
            onStop: (html jQuery this effect
               percent: 1; puff;
               onComplete: (html jQuery this parent load html: [ :r |
                  self selected remove: each ifAbsent: [ ].
                  self renderSelectedItemsOn: r ]))) ]

    super initialize.
    self selected: Set new

If someone can help me with the drroppablezone method. I tryed a lots of
things, I searched on the Internet, on the source code but I didn't find

A. Cervoise
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100422/f613c554/attachment.htm

More information about the seaside mailing list