similar to: how to create RJS visual effects callbacks

Displaying 20 results from an estimated 5000 matches similar to: "how to create RJS visual effects callbacks"

2006 Mar 27
7
rjs template ? (how to check for existence of a dom element?
In my rjs template I''m using the following line. page.visual_effect :slideUp, ''comment_error_details'', :duration => 0.5 It works fine if I have created the div with the id="comment_error_details", but if I haven''t created the error yet then my whole rjs template fails. How can I check to see if an element has been created? I could then put
2006 Jan 19
1
rjs problems
Hi, I am having trouble with rjs templates. Basically I want the item_div to fade if its already open and then display the new item that the user selected with the visual effect: appear. The code below causes the browser (firefox on osx) to open the div and then close it again as soon as it is open: page.visual_effect :fade, ''item_div'', :duration => 0.5 page.replace_html
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility ==
2005 Dec 25
5
RJS not working?
I''ve been attempting to add a simple rjs ''delete'' method to my project. However, no matter what I try, it simply doesn''t work. Even the easy, easy stuff seems broken. (Yes, <%= javascript_include_tag :defaults %> is being included in the template.) For example, from: http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates VIEW: <h1
2006 Apr 27
7
RJS & Ajax question...
Hi, I''m trying to convert an older Rails application to use Ajax. I''ve already moved my edit and show actions so that, instead of displaying as separate pages, they appear in a <div> on my list view. However, I have two problems: 1) When the user saves the changes, I want to put all the ajax changes in an RJS template. However, form_remote_tag :url =>{:action =>
2006 Jul 31
4
RJS to find an element
I''m trying to implement a remove from cart method based on the examples in the second edition Agile book. I have everything working except for the RJS that removes items from the cart. Ideally what I''d like to do is highlight an element that I am deleting only if there is more than one of that particular item in the cart. If the item deleted is the only of
2006 Jun 24
6
Ajax fade effect
I have a list of categories, when I delete one of them, I want that item to fade and then get removed. So I do the following: 1. home_controller: def delete @category = Category.find_by_name(params[:name]) @element_id = @category.name Category.delete_all(["name = ?", @category.name]) end 2. delete.rjs: if @element_id page.visual_effect :fade, @element_id
2006 Jul 20
5
RJS where to put helper method?
Hi, If I want to have helper method for my rjs, where''s the best place to put it? so for example: --- bla.rjs: page.replace_html ... page.visual_effect ... --- somewhere: (currently I put in application_helper.rb) def replace_with_effect(page) page.replace_html ... page.visual_effect ... end --- bla.rjs: replace_with_effect page and is there a way to define the helper so we
2006 Jul 16
6
How to access element attributes using RJS?
For example, in the following block: page.select(''.foo'').each do |element| ... end How would I access, just for example, the id attribute of each element in the collection? I''ve randomly tried element.id and element.attributes[''id''], but neither of those has worked. I''ve also been unsuccessful in finding any documentation on this, but it
2006 Apr 03
5
RJS Queue
Hi, I''ve been able to succesfully queue page.visual_effect commands in my RJS templates. Each command will wait to execute until the previous command is done executing. But I''d also like to execute a page.replace_html command AFTER the page.visual_effect commands. I have a series of five DIVs: div1 div2 div3 div4 div5 When the user clicks on div1, a page.visual_effect
2006 Mar 07
12
rjs and partials
I''m trying to update a list, and having a hard time applying visual effects to the latest element created. Here is what I''m doing. =========================================== 1) Creating an "item" via an action, then rendering the RJS template 2) RJS template looks like this: page.insert_html :top, ''items'', :partial =>
2006 Feb 06
6
.rjs template doesn''t load?
Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060206/cf123b71/PGP.bin
2006 Apr 04
7
Not getting the whole RJS-based partial rendering concept ...
I have been trying all kinds of different ways to produce what I think should be a simple effect, but have not had any luck yet and apparently I am not following the general idea... What I am trying to accomplish is the following (part 1 works and part 2 does not): 1. One of my views has a link_to_remote which updates a div container with a table of data my example is <div
2006 Apr 03
4
page.visual_effect :highlight not working
I just upgraded Ruby to 1.8.4 and Rails to 1.1 and I''m in the middle of changing my Javascript code over to the Scriptaculous helper functions. page.visual_effect :highlight, "some_div" seems to be broken. Instead of fading, the background color of the element stays highlighted. page.visual_effect works for other effects, though. Any ideas? Thanks. -- Posted via
2006 Jun 11
6
page.update_html not executed
Hi, when doing: render :update do |page| page.replace_html ''suggested_contractors'', :partial => ''contractors'' page.visual_effect :highlight, ''suggested_contractors'' end I got js as output, it is not executed, return html *contains*: try { Element.update("suggested_contractors", " \n 12345678910\n \n
2007 Jan 11
3
Strange behaviour with Scriptaculous v 1.7.0 beta 2
Hello, I''m testing beta of scriptaculous and I''ve got a stange behaviour. I''m using this RJS : page << "$(''content'').morph({width:''308px''}, {duration:0.5});" page.replace_html ''subcontent'', :partial => ''sub'' page.replace_html ''nav_path'', nav_path
2006 Jul 06
2
rjs rails to execute?
I have the following: layout: <%= javascript_include_tag :defaults %> [...] <div id="menu"> <div id="myrandom"></div> <%= render :partial => ''menu'' %> </div> menu partial: <%= link_to_remote "Generate Text", :update => ''myrandom'', :url => { :action =>
2006 Jul 03
6
Rjs $("aaa").insertHtml is not a function error
Hi, I''ve searched the list and found that someone had the same problem as me http://lists.rubyonrails.org/pipermail/rails/2006-May/043760.html I''m have in my page a link like this <%= link_to_remote ("Add #{image_tag(''add.png'')}",:url=>{:action=>''addProduct''})%> and in my controller def addProduct ..................
2006 May 02
4
passing data from controller to rjs and then to partial
Hello Experts, I am fetching data in my controller from a web service def search response = @@api.DoSearch() end and in my .rjs template, I am doing page.replace_html ''fields_chooser'', :partial => ''fields_chooser'' ,:locals =>{:response => response} page.visual_effect(:Appear, ''fields_chooser'') and in _fields_chooser.rhtml, I
2006 Jul 27
3
How do I update a div''s content in the controller?
Without using an RJS, is there a call I can do in the controller? All I want to do is this statement, but in the controller: new Effect.toggle(''notifier_nav'',''appear'', {duration:12.0}); Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.