Hi all,
is anyone able to explain to me the role of the handle option with
Sortable ?
I read the doc but it didn''t help me.
Sortable :
handle :""Makes the created Draggables use handles, see the handle
option on Draggables.""
Draggable :
handle in V1.0 : "" Sets whether the element should only be
draggable by an embedded handle. The value must be an element
reference or element id ""
handle in V 1.5 : "" As above, except now the value may be a
string referencing a CSS class value. The first child/grandchild/etc.
element found within the element that has this CSS class value will be
used as the handle. ""
My goal is to init the drag of an element only with one child of this
element.
Is it possible ??
An example :
<table border="0" cellspacing="0"
cellpadding="0"
class="tableauListe">
<thead>
<tr>
<th>Libellé</th>
<th>SearchWidget</th>
<th>Editer</th>
<th>Supprimer</th>
<th>Tri</th>
</tr>
</thead>
<tbody id="sortableId__{idlist}"
name="{idlist}">
<!-- BEGIN: row -->
<tr class="bleu1"
id="formulaireChamp_{__oid__}">
<td>{champ_idchamp.libelle}</td>
<td>{searchwidget}</td>
<td>{edit}</td>
<td>{delete}</td>
<td><img class="trieur"
src="images/move.png"
alt="trieur" title="Trier..." /></td>
</tr>
<!-- END: row -->
</tbody>
</table>
<!-- BEGIN: sortableInit -->
<script type="text/javascript">
Sortable.create( ''sortableId__{idlist}'', { tag
: ''tr'',
handle : ''trieur'', onUpdate : triable } );
</script>
<!-- END: sortableInit -->
<!-- END: table -->
Ideally, the user could only move the row by dragging the img.
Thanks for reading.
Florian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Sure. If I read your code correctly, then you could set a class="dragme" on the part you want to be able to drag by, then set the handle property in the parameters to ''dragme''. Scriptaculous will work out that you only want to be able to drag by the part with that classname. Walter On Aug 29, 2007, at 7:58 AM, florian wrote:> > Hi all, > > is anyone able to explain to me the role of the handle option with > Sortable ? > > I read the doc but it didn''t help me. > > Sortable : > handle :""Makes the created Draggables use handles, see the handle > option on Draggables."" > > Draggable : > handle in V1.0 : "" Sets whether the element should only be > draggable by an embedded handle. The value must be an element > reference or element id "" > > handle in V 1.5 : "" As above, except now the value may be a > string referencing a CSS class value. The first child/grandchild/etc. > element found within the element that has this CSS class value will be > used as the handle. "" > > My goal is to init the drag of an element only with one child of this > element. > Is it possible ?? > > An example : > > <table border="0" cellspacing="0" cellpadding="0" > class="tableauListe"> > <thead> > <tr> > <th>Libellé</th> > <th>SearchWidget</th> > <th>Editer</th> > <th>Supprimer</th> > <th>Tri</th> > </tr> > </thead> > <tbody id="sortableId__{idlist}" name="{idlist}"> > <!-- BEGIN: row --> > <tr class="bleu1" id="formulaireChamp_{__oid__}"> > <td>{champ_idchamp.libelle}</td> > <td>{searchwidget}</td> > <td>{edit}</td> > <td>{delete}</td> > <td><img class="trieur" src="images/move.png" > alt="trieur" title="Trier..." /></td> > </tr> > <!-- END: row --> > </tbody> > </table> > <!-- BEGIN: sortableInit --> > <script type="text/javascript"> > Sortable.create( ''sortableId__{idlist}'', { tag : ''tr'', > handle : ''trieur'', onUpdate : triable } ); > </script> > <!-- END: sortableInit --> > <!-- END: table --> > > Ideally, the user could only move the row by dragging the img. > > Thanks for reading. > > Florian > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Walter ! Thanks for your response ! I''ll try it back because I''ve already tested that. I don''t know why it didn''t work. Bye --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
It''s now fixed !! I''ve surely done something wrong the first time I tried... With my prototyp''est respects. Florian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---