Displaying 20 results from an estimated 1000 matches similar to: "Storing order of sortable objects in RoR"
2006 Apr 14
1
Problems using Sortable with an onUpdate callback
Hi all:
I''m using sortable (very cool stuff!) on a series of divs with an
onUpdate callback. Everything appears to work alright until I try to
pass a parameter to my callback function like this:
Sortable.create( ''page_33'',
{
tag: ''div'',
onUpdate: updateOrder(''page_33'')
}
);
When I pass that parameter to the
2006 Jun 28
1
sortable lists, database update
Hi,
I have some images and I want to be able to drag them into the order I
want and have the database updated accordingly. I have an unordered
list elsewhere in the application that works well, but for the images
I cant get it working.
In my controller I have:
def updateorder
params[:images].each_with_index { |id,idx| ProductImage.update(id,
:display_order => idx) }
render :text
2006 Jul 17
1
sortable_element - Altering defaults set by rails
Hi there, I''ve got the following code to generate two sortable elements
but whenever someone drags and drops an item, i only want it to return a
serialised list of the items in categoryartworks, the unlinkedartworks
can be in any order and I don''t care. I can then delete those artworks
that were in category artworks but aren''t in the serialised list, plus
reorder
2007 Nov 02
3
script.aculo.us: onUpdate in Sortable.create
Can''t seem to get the onUpdate to work in for a sortable list. I am
following the documentation and the included functional tests but
nothing is firing for me. Any idea why?
Sortable.create(''list1'', {
tree:true
, onUpdate:function(sortable){
alert(''onUpdate'')
}
, handle: ''handle''
, scroll:window
,
2006 Jul 20
1
Scriptaculous + Sortable: onUpdate Not Firing
Hello all,
I''m using Scriptaculous 1.6.1 on a project I''m developing. My
generated HTML (generated by PHP) looks something like this:
<ul id="admin-list">
<li id="li-13">Singletary, Bob (President/CEO)</li>
<li id="li-12">Chatman, Jim (Vice President of Finance/CFO)</li>
...
</ul>
<script
2005 Aug 02
3
Scriptaculous: Sortable (dragdrop.js) onUpdate
Hi all,
In the following code, it doesn''t look like the onUpdate() event is firing.
Am I doing something wrong?
<ul id="testSort">
<li id="item1">item 1</li>
<li id="item2">item 2</li>
<li id="item3">item 3</li>
<li id="item4">item 4</li>
<li id="item5">item
2006 Jan 24
8
scriptaculous sortable
Hi,
maybe I am using this the wrong way but I have a list as follows
<ul id="secondlist">
<li>bla bla</li>
<li> bla bla </li>
</ul>
and then I add dynamically further <li> elements and create a Sortable
but the onUpdate only fires for <li> items that have not been created
via Javascript.
Any clues?
<script
2006 Apr 05
1
Nuby Sortable Question? How do you pass multiple lists back to the server
I have multiple drag and drop lists. If you sort within one list, you can
pass the list back to the server using:
<%= sortable_element ''task-list'' << person.id.to_s ,
:url => { :action => "noop", :id => @user },
...
%>
Which causes this to be included in the javascript:
onUpdate:function(){new
2006 Mar 29
0
MaxConnections in IE and Ajax.Request/Sortable
Hi all,
IƤve built some functionality in a CMS where you can drag and drop
small elements on the page between 2+ panes/containers/divs. Whenever
a drag-drop event has occurred (onUpdate) I make a Ajax.Request to
save the new layout in the CMS.
The code is as follows:
in an onload-function:
var a = ["subcontent", "main"];
for (var i=0; id=a[i]; i++) {
if ($(id)) {
2006 Jun 14
5
Sortable Tree - Stoping Event dispatch ?
Hi,
I''m trying to play with sortable tree and have two issues:
I have an AJAX Tree looking like:
<ul class=''TreeCat'' id=''work''>
<li class=''open''>
<img src=''s.gif'' class=''node'' onclick="Ajax.Tree.toggle(event,this);"/>
<a
2006 Mar 31
2
RE: drag and drop sorting with an empty lis
I ran into this issue too. My solution was to add an "onUpdate" function to
the sortable that tests the container to see if it''s got any children or
not:
function is_empty(container)
{
if ($(container).hasChildNodes()) {
Element.removeClassName($(container),''empty'');
} else if (!$(container).hasChildNodes()) {
2006 Feb 01
1
Sortable onUpdate problem
Hi,
I have two sortables with different options (but same tags. just
''li''). When I drag an item from sortable1 to sortable2 I want it to
gain the options that the sortable2 items have.
I''ve tried all day to understand how Draggables and their observers
are destroyed but I keep gettting buggy behavior. Part of the problem
is the draggable and the draggableObserver are
2006 Jun 13
1
Element.remove parent div
Hi all,
Currently I am using Element.remove like so:
<div class="blurb" id="drag_1">
<a onclick="Element.remove(''drag_1'');" class="remove"></a>
</div>
However I would like to just create a function since I''ll be removing
multiple DIVs and updating the sortable order. I just can''t get some version
2005 Jul 08
3
Problem with script.aculo.us 1.0
I just upgraded to the new version and now my storable containers are
not working. here is my code.
Sortable.create("leadstories",
{handle:''handle'',tag:''div'',containment:''leadstories'',onUpdate:
function(element) { new save_order(issueId,Sortable.serialize(element));
}});
Sortable.create("rightnav",
2006 Aug 11
14
Sortable callback, when dragging starts/stops
Hi *,
is there a callback or something else to get noticed, if the user starts
(stops) to drag an element of a sortable? I only found the onUpdate and
onChange callbacks, but they don''t give the information I need.
Thanks in advance,
Tim
2005 Sep 23
1
Sortable list with Ajax and delete function - working example
Hi.
I read most of the postings here but unfortunately I didin''t found a complete example which could be used. Of cource the ones who are professionals in javascript could implement the missing peaces from the puzzle.
What I''m required to do is a tree (sortable list) where items can also be deleted and at each modification a function (ajax) is called to save the changes. For
2005 Dec 11
1
redering CDATA wierdness
I am attempting to do the sortable_element tutorial from scriptaculous.
(http://demo.script.aculo.us/ajax/sortable_elements)
Upon viewing the script.aculo.us source, I see this line is generated...
<script type="text/javascript">Sortable.create(''list'',
{onUpdate:function(){new Ajax.Updater(''list-info'', ''/ajax/order'',
2006 Jan 23
8
question about Sortables
So, is there any way to specify a sortable to only do a callback when
the dragged item is dropped? As it is, the onChange is called whenever
you move the draggable to a new element (even if you don''t drop it), but
I''d rather only call my function after they drop it to avoid unnecessary
additional server calls. It looks like Droppable supports an ''onDrop'',
but
2006 Feb 27
4
Getting nuts with sortables...
Folks,
It has been a whole day spent on this but I still can''t get my mind
around the most probably very stupid/basic mistake here... First, the
code I use:
<h3>List A</h3>
<ul id="lista" >
<li id="item1"> Item 1</li>
<li id="item2"> Item 2</li>
<li id="item3"> Item 3</li>
</ul>
2006 Jun 29
0
Sortables question
Hello,
I am new to Scriptaculous, and was recently brought into a project using
it to create an email Newsletter builder. The idea is that the user
will have lists of elements that he can add to the email page by
dragging the element he wants to add from an "available sections"
container, to a "loaded sections" container. Dragging from the loaded
to available will