similar to: rjs: using show and hide, vs replace?

Displaying 20 results from an estimated 50000 matches similar to: "rjs: using show and hide, vs replace?"

2006 Mar 31
5
RoR 1.1 RJS problem
I''ve been playing with the new RJS stuff in RoR1.1, and I have to say that I''m am extremely impressed, NICE! work guys. However, I seem to be having a bit of a problem. I promise, I''ve googled the hell out of it and haven''t found an answer. Set up: Putting together a little proof of concept app. Display a form (index.rhtml) that just has a button to
2006 May 03
3
Graceful degrading AJAX show/hide
Ok i''ve done a bit of hunting around and I can''t find much documentation on how ensure an ajax call through an rjs file degrades with javascript off. Essentially, if javascript is off, I want to refresh the page and pass a variable from the controller to the page the user is on. Not use the rjs file. At the moment i have this: <%= link_to_remote("Advanced Search",
2006 Jun 27
2
Bug in Firebug or in RJS? Or something else?
I''m getting a really strange result using RJS page.replace_html and wonder if anybody knows anything that could help me figure it out. I''m rendering a partial in a loop in edit.rhtml that puts a set of <div>s on the page, each <div> containing a checkbox_tag with an associated observe_field and a text_field_tag also with an associated observe_field. When the
2006 Jul 31
2
RJS: hide element problem
Hi, I am trying to hide a "intro" text shown to user the first time after he has made a search, in the website with RJS/Prototype "hide". I get the following error: RJS Error: Type Error: element has no properties. The text I would like to hide is in a div called "intro" and in my RJS I tried: - page.hide[:intro] as well as - page.hide ''intro''
2006 May 12
0
RJS, Safari, Error - DOM exception 7
I''m having nasty cross-browser headache. Not new to Rails, but quite new to AJAX/RJS. My app works perfectly in Firefox, but generates the error in the subject line in Safari. Pretty simple circumstance, completely reproducible in all cases: Any ideas? Relevant code attached. Layout: ------- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC
2006 Mar 22
1
RJS - Still not working in IE
The previous thread on this topic got a little disjointed, so I thought I''d summarize the issue again, in hopes that someone could help. To re-iterate, this rjs works in Firefox and Safari on Mac, and in Firefox on Windows. It fails, in IE on Windows. The failure is that the second page.replace_html seems to do nothing. My environment is: Rails 1.0 + RJS Plugin Updated
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 Feb 14
2
Inline list editing with RJS: best practices
I wanted to get the community opinion on the best way to use partials and inline list (<li>) editing. I have a very common scenario where a list is rendered: --- index.rhtml --- <ul> <%= render :partial => ''item'', @collection => @items %> </ul> --- _item.rhtml (simplified) --- <li id="item_<%= item.id %>"> <div
2007 Aug 20
0
FormBuilder in rjs
I have a page, which renders a partial that contains a ''State'' drop down list. Upon change, it re-renders the ''City'' drop down, re- populating it based on selected state_id: Page: /customer/new.rhtml <% form_for :customer, :url => customers_path do |f| %> State: <%= f.collection_select :state_id, State.find(:all), ''id'',
2007 Feb 13
1
RJS specs
Hi again... This is wierd spec problem no. 3. I''ve got a simple one line RJS file that renders a partial specified by the controller page.replace_html("product_info", :partial => @product_partial) The partials in question will contain purely static content - the idea is to have some dynamic links, so you hit http://localhost:3000/gap/product_info/product_1
2006 Apr 07
3
RJS removing content of div, but not div itself
Hi, I''m creating a list of ingredients on a page. When the user clicks the ''Add Ingredient'' button a record gets added to the db and the ingredient gets added to the page. On the page, each record is represented by a <div> with three <span>s inside. One of the <span>s has a link_to_remote to ''delete'' the ingredient. When the link
2006 May 29
3
IFRAME based RJS - responds_to_parent
** File uploads with AJAX mojo ** Respond with RJS to your parent window with a form action targeted to a hidden IFRAME. Handles all the painful situations like scoping your JavaScript to your parent window generating the script block for execution and clearing the IFRAME after execution so the back button doesn''t re-execute the action. `plugin install
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 Jan 29
2
GetText and rjs templates?
hi, is it possible that gettext don''t work with rjs templates? i''ve just tried this simple example blog_controller.rb : class BlogController < ApplicationController def index end def dosomething end end index.rhtml : <html> <head> <%= javascript_include_tag :defaults %> </head> <body> <div id="test">Some text to change
2006 Apr 11
5
RJS adds comment but doesn''t update form
Hi, When a user adds a comment i want to add the comment to the end of the comments list using ajax so there is no full page refresh. The code i have below adds the comment to the database but doesn''t update the comments div with the new comment. Can anyone help? This is my first use of rjs templates and i have read http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
2006 Apr 22
3
rjs woes, any hints?
I''ve pared my rjs experiment down to what seems a bare minimum. When I click on my link_to_remote, the rjs executes, returns the correct javascript to the browser, but it doesn''t update the div I''ve specified. What appears to be coming back from the controller is: Element.update("my_form", "hello, rjs"); I''m tearing my hair out.
2006 Mar 14
2
RJS & Unicode (again)
I have a problem with unicode & RJS. I searched several boards & blogs, but was not able to find a solution. Let me explain my problem with an example. View (test.rhtml): ... <div id="a_test_div">?????????</div> ... Output: ????????? RJS-Template (an_action.rjs): page.replace_html ''a_test_div'', ''?????????'' Calling
2007 Feb 17
0
Template is missing 'show.rjs.rhtml' error in safari only?
I was able to solve this but want to understand why this fix works. Solution: Remove the format.js line from the respond_to block the error i get when navigating to: /music;accept Template is missing Missing template script/../config/../app/views/music;accept.rjs.rhtml Accept is an aspect of the music controller eg in routes.rb map.resources :music, :collection => {:accept =>
2006 May 01
1
Show/Hide with AJAX
I''m trying to implement a show/hide details function. I have the show part done, but I''m not sure how to get it to hide. My app looks like this so far: View: <%= link_to_remote "Show/Hide", :update => "details", :url => { :action => "show", :id => leif } %> <p id="details"></p> Action: def show @leif =
2006 Jun 23
2
Queue 3 or more RJS actions
My .rjs file page.visual_effect :BlindUp, "people", :queue => ''front'' #first action page.replace_html "people", :partial => ''person/person_compressed'', :collection => @search_results , :queue => ''end'' #second action, after first is done page.visual_effect :BlindDown, "people" , :queue =>