Displaying 20 results from an estimated 4000 matches similar to: "Using javascript with update_element_function"
2006 Feb 01
0
Using draggable_element doesnt work with update_element_function
Hi everyone,
I am writing a ruby on rails application, and making heavy use of AJAX calls
and evaluate_remote_response. In my remote responses I often have several
update_element_function calls going on, to update several divs on the page.
What I am doing is calling update_element_function, with the content as a
block. Inside the block I usually have html, or make calls to other partials
or
2010 May 03
0
Scriptaculous, snap draggable to droppable or revert
Hello community,
I am a fairly new RoR programmer and I need some help with Scriptaculous
Drag and Drop:
So I have
<%= draggable_element(@div_id, :revert => "failure", :snap => 5) -%>
and a droppable:
<%= drop_receiving_element(@team_div_id, :with => "''player='' +
(element.id)+ ''&position='' + #{draft_position}"
2006 May 24
0
Javascript as content parameter for update_element_function?
Is there any way to do this? The goal is to have the update_element_function
update a div with alternating strings. Is there a better way to do this?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060524/a99b90de/attachment.html
2006 Jun 14
3
problem trying to update multiple <DIV> elements with AJAX
I''ve been trying for days now to figure this out on my own, but I can''t,
so this is my cry for help. Here''s my situation: I need to update
multiple <DIV> elements on a page, each with its own HTML, but I just
can''t figure out how to get it to work. That is, I want to replace
everything within each <DIV> element with something new. When I try what
2005 Dec 24
2
Ajax Help: Multiple Updates - ?
Hi!
Wondering if anyone can tell me what''s wrong with my code?
I''m trying to use the onChange event of a select list to update multiple
divs...
Agile Web Development with Rails (p. 403) suggests using ":complete =>
eval(request.responseText) instead of :update"
I''ve attempted the following test code:
# in the view
<select name="plist",
2006 Jan 20
1
[protoype] Problem with Effects on draggable element if revert is true
hi,
I have a draggable element (cart-item) in a shopping cart
<%= draggable_element "item_#{product}_#{i}", :revert => true %>
When this element is dragged outside the cart into the "main_div", I want to
show a puff effect and remove the element. When it is dragged within the
cart, it should revert.
So i wrote this code for drop_receiving _element
<%=
2005 Dec 30
4
AJAX Drag and Drop Detecting Drop Coordinates
This one''s kicking me in the *(&#^. All I want to do is create a draggable
item and then detect the coordinates where it is dropped. So my first
approach was to just use the draggable_element with :revert => false, like
so:
<%= draggable_element "my_element", :revert => false %>
That works great and lets me drag stuff all over the place. In the
scriptaculous
2007 Jul 26
1
Scroll Page While Dragging 'draggable_element'
Hi - I posted this on another list, but received no response, so I''m
trying this one. My apologies to those who have seen this question
twice.
I have two columns, one of draggable elements, the other of
droppable elements. These are used to add items to a particular
collection. (Story :habtm ''Assets'')
Column 1 (Assets) Column 2 (Stories)
==============
2006 Apr 07
0
weird problem with draggable_element in a partial rhtml
Hi all,
I have an index.rhtml page which calls a partial called _tasks.rhtml. In
the latter i call <%= draggable_element("icon#{@tasks.id}", :revert =>
true)%>. The first display of my page works fine and I get
<script type="text/javascript">
//<![CDATA[
new Draggable("icon32", {revert:true})
//]]>
</script>
But then if I have an ajax
2007 May 14
8
Problem with script.aculos.us script
I''m newbie to rails application.
I like to use script.aculos.us script in my app.
I faced the following problem.
1. first i creat my application.
2. Then I copied the files
scriptaculous.js, builder.js, effects.js, dragdrop.js, controls.js and
slider.js
and prototype.js
into my app/public/javascripts/
3. Then included the <%= javascript_include_tag :defaults %> code into
head
2008 Apr 03
0
draggable_element Messing up CSS for IE7
I am having trouble with draggable_element and come IE7 css. I have a
list where I want the items in the list to be draggable. I need the
list to have a fixed height so I would like a scrollbar. I use
overflow:auto and everything works great in Firefox and Safari. But
IE doesn''t respect the overflow:hidden. Well, it kind of does. It
creates the scroll bars but lets everything spill
2005 Dec 07
3
update_element_function fail gracefully?
I am using the update_element_function to update the text in some
elements. This works fine, however, if I try to update an element
that is not on the page anymore, it fails silently and no further
javascript statements will be executed within that same
request.responseText. Is there a way to fail gracefully in this
scenario and ignore the missing elements?
Thanks,
Tom
2005 Jul 19
0
draggables bug(s)
Loving using draggables/sortables in rails... two small issues though -
First bug: creating a draggable object with a handle in rails:
<%= draggable_element "item_#{item.id}", :handle=>"myhandle" %>
this generates code like this:
<script type="text/javascript">new Draggable(''item_7'',
{handle:myhandle})</script>
***
2005 Jul 20
3
examples of drag n drop
Sorry if this sounds cynical, ( i do love script.aculo.us scripts ) ,
but I am wondering if people know of some good real world
examples of uses of drag n drop and sortable lists.
such a cute script will likely be *ab*used as much as it is used.
obviously the point here is to use script.aculo.us to improve
the user interface rather than just have some k00l eFX.
e.g. the drag n drop instantly
2006 Mar 02
4
Instance variables in Javascript param
How can I make this work ?
<a href="#" onclick="new Effect.Fade(@div_id)"></a>
@div_id is an instance variable ?
TIA
--
Posted via http://www.ruby-forum.com/.
2006 Mar 15
4
RJS template eating encoding
I was previously doing an update via .rhtml templates creating an AJAX
:evaluate_remote_response. I use UTF-8 in my pages, and my app
requires that I be able to, say, put Japanese characters in.
The problem is that when I switched this over to an RJS template it
started eating the encoding. I now get garbage characters where before
I got the correct ones.
The code for the RHTML:
<%=
2009 May 25
0
Draggable ghosting
can anyone tell me how to make a Draggable element, which after drop
doesn''t disappear.
draggable_element "item_#{item.id}", :revert => true, :ghosting => true
- don''t work, adding element disappears.
--
Posted via http://www.ruby-forum.com/.
2007 Nov 16
1
drag & drop list needs refreshing
Hello guys, I''m a scriptaculous newbie (I started working with it only
yesterday) and I have already the first problem.
I''m trying to implement a drag & drop list (fallowing the shopping
cart example http://demo.script.aculo.us/shop) and I''m almost done
but after dropping an item on the target div I need to refresh the
page to see that the item has been moved.
2005 Nov 11
0
A couple of draggable patches...
Hi all,
I've just raised a ticket <http://dev.rubyonrails.com/ticket/2826> with a
patch for enabling 'snapToGrid' feature for draggables.
I'm writing a framework on top of scriptaculous and it appeared to me that
this would be something that could belong to core Draggable objects.
To activate, just add to draggable options on creation. (By default gridSize
is set to 10)
2006 Feb 28
0
Question abour Draggables & Droppables - my code example
hi i think my example is very simple and straightforward so i''m not sure if
it meets your needs (change revert:true to revert:false from a draggable
after I drop it on a droppable so it doesn''t return to its original place.)
i did this
# 2 divs created here
<script language="javascript">
new Draggable(''drag'', {revert: false});