How do I get the ID of the sortable that is being dragged?
Here''s my code snippet:
columns =
[''twothirds_column'',''onethird_column''];
Sortable.create(''twothirds_column'', {onUpdate:getPortalOrder,
dropOnEmpty:true,ghosting:false,tag:''div'',containment:columns,handle:''handle'',only:''drag_panel''});
Sortable.create(''onethird_column'',
{onUpdate:getPortalOrder2,dropOnEmpty:true,ghosting:false,tag:''div'',containment:columns,handle:''handle'',only:''drag_panel''});
I''ve tried passing values to the callback function, but all i get is
the parentID (either twothirds_column or one_thirdcolumn). I need to
get to the id of the draggable (ex. twothirds_column_1).
Anyone know how to do this? I''m lost :(
Thank you!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
dsfsfsdfsfsdf-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org
2008-Jan-18 14:57 UTC
Re: Sortables.create...get draggable ID
you should use the sortable.serialize-funktion..
function updateList(twothirds_column) {
var temp_out = Sortable.serialize(basis);
var output = new Array();
temp_out.split(''&'').each(function(el) {
output.push(el.split(''='')[1]);
});
and can use the output[] to get the numbers.. later you have to search
for the id..
On 11 Jan., 03:05, Loony2nz
<Loony...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> How do I get the ID of the sortable that is being dragged?
> Here''s my code snippet:
>
> columns =
[''twothirds_column'',''onethird_column''];
> Sortable.create(''twothirds_column'',
{onUpdate:getPortalOrder,
>
dropOnEmpty:true,ghosting:false,tag:''div'',containment:columns,handle:''handle'',only:''drag_panel''});
>
> Sortable.create(''onethird_column'',
>
{onUpdate:getPortalOrder2,dropOnEmpty:true,ghosting:false,tag:''div'',containment:columns,handle:''handle'',only:''drag_panel''});
>
> I''ve tried passing values to the callback function, but all i get
is
> the parentID (either twothirds_column or one_thirdcolumn). I need to
> get to the id of the draggable (ex. twothirds_column_1).
>
> Anyone know how to do this? I''m lost :(
>
> Thank you!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---