[Seaside] How to Save a sorted list in Scriptaculous

Rajeev Lochan lochan94 at gmail.com
Tue Aug 28 21:09:28 UTC 2007


Thanks Lukas,
I shall incorporate changes and come back



On 8/29/07, Lukas Renggli <renggli at gmail.com> wrote:
>
> There are many different problems with your approach:
>
> > ListView>> renderContentOn: html
> > html form: [
> > html render: self model title.
> > html div class: 'items';
> >                  script: (html sortable tag: 'div';
> >                     onUpdate: (html request
> >                     triggerSortable: 'items'
> >                     callback: [:col | self model items: col]));
>
> If you say the sortable should use 'div' tags, then all elements
> inside your container should be of that kind. Check out the method
> comment of #tag:
>
> >                 with: [
> >                     self model items do: [:eachItem| self
> > renderItemOn:eachItem].
> >                      html submitButton callback: [self answer: self
> model]]]
>
> Uhh, the button should be outside the container.
>
> > ListView>> renderItemOn: anItem
> > html
> >         table: [html
> >                 tableRow: [html tableData id: 'checkBoxItem';
> >
> >                         with: [html checkbox value: anItem done;
> >
> >                                 callback: [:value | anItem done:
> value]].
> >                     html tableData id: 'myListEditItems';
> >                         passenger: anItem;
> >                         with: [
> >                             html render: anItem title]]]
>
> The sortable elements should be DIV-tags, if you declare them to be
> DIVs. Tables in general don't work together with drag&drop, so avoid
> them altogether (see documentation of script.aculo.us).
>
> Furthermore you need to assign the #passenger: to the direct child of
> the container (the DIV). Again see the documentation of
> script.aculo.us.
>
> > The page is rendered and the items can be sorted. The sorting is only
> done
> > on the client end. If I submit the button, the new order of the items
> isn't
> > updated. Am I missing anything ?
>
> That's because you tell Scriptaculous to only consider div-tags, but
> you add table-tags as children.
>
> Have a look at SUSortableTest for a working example.
>
> HTH,
> Lukas
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>



-- 
Rajeev Lochan

Co-founder, AR-CAD.com

http://www.ar-cad.com
+91 9243468076 (Bangalore)
080 65355873
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070829/ea9d09d1/attachment-0001.htm


More information about the seaside mailing list