similar to: running an rjs function on page load

Displaying 20 results from an estimated 60000 matches similar to: "running an rjs function on page load"

2008 Mar 14
0
problem with rjs and marker group
Lo there all, i have a function that builds a bunch of markers to go on a google map. I would like to update them with rjs. Here is what i have so far. def map_main_layout @zoom = params[:zoom].to_i @zoom = 14 if params[:zoom].nil? @map = GMap.new("map_div") # @map.control_init(:large_map => true, :map_type => true) # (inserts map control) # place
2006 Apr 21
3
rjs in multiple ajax page
Sorry for the long explanation but I''m having trouble integrating rjs into my form page. Here''s my page: <div id="posts"> <ul id="post_list"><%= render :partial => ''list_results'', :collection => @posts %></ul> <p><%= link_to_remote(''+'', :url => {:action =>
2006 Mar 08
2
RJS - page object in helpers?
Hello, I am using RJS and Edge Rails and I was wondering if the page object should be available in helpers also. For example if I have a helper function def update_flash_messages page.replace_html ''flash_messages'', (show_flash_messages :textilize => true) page.visual_effect ''flash_messages'', :appear end and then in my RJS files I call
2006 Aug 07
1
Unable to page.replace_html from rjs
I am having problems updating a div defined in a partial using both Element.update and page.replace_html in an rjs. I can put a link_to_remote in the partial using an :update, and the div updates fine. Does anyone have any idea why this might be happening? In the partial: <div><div> . . <div id="question_<%=question.id%>_error"></div> . (if a
2006 Jul 20
0
RJS and calendar_helper troubles .... tab characters covering web page
We have implemented calendar_helper.rb to generate an ajaxified calendar using rjs templates. Everything worked fine until we added a drop down to select the current month. Now when select a month and the calendar refreshes to that selected month we get a ton of ''\t'' displayed all over the page inside what looks like to be a javascript debug print statement ( try {} catch{} block
2006 May 28
1
RJS template / page.insert_html problem
Hiall, I have a rjs template which is calling page[:xxx].replace_html ... a couple of times and this works perfectly. However, in the same rjs file I have two calls to page.insert_html, which do not work. No error in development.log, nor error message in browser, the new content for the div simply isn''t changed at all. This is my code: ... action = "save_" +
2006 Aug 01
6
Getting Started on RJS Templates
I definitely need to use RJS templates for my current application. I''ve used Google for the past twenty minutes or so, yet I can''t find a good resource that will get me started and show me what the page object can do. Any links? When an Ajax link is clicked, I''m trying to change the background of a "primary" list item, as well as the background and text of
2006 Nov 18
2
RJS page.delay timing issues
Hi. Has anyone ran into issues with the timing of page.delay. I have been testing in firefox, for the most part, and it seems that there is no reliability on when the page.delay timings kick in. What happens is that sometimes it will work fine, and the countdown looks great; other times it will just jump to the end and display everything at once, other times it will be jerky. I''m on a
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 =>
2008 Jan 15
2
rails rjs page object
Can anyone point me to api documentation for the page object that is used in rails rjs files? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send
2006 Jul 03
1
plugin to add method to rjs "page" object
Hi, I would like to add a new method to the rjs "page" object through a plugin. For a simple example, suppose I want to add the following which is really just an alias for the usual page.replace_html. def replace_html2(id, *options_for_render) call ''Element.update'', id, render(*options_for_render) end How can I stitch this new method
2006 Apr 22
1
RJS, scriptaculous, page.replace problem with input fields?
I''m hoping someone can help... I have an rjs template that invokes a couple of page.remove() calls that work fine, and a page.replace() call that does not. I''ve played with the javascript extensively from within Firefox''s FireBug module, and it seems to me that this is what is happening: What I''m trying to replace is an element that''s been
2009 Jan 15
1
Sequential "page." commands in a js.rjs file?
After the (remote) delete action for my lesson_categories controller i fall through to this js.rjs file: page.visual_effect :fade, "lesson_category_#{@lesson_category.id}", :duration => 1 page.remove "lesson_category_#{@lesson_category.id}" The problem, though, is that the visual effect is initiated, then the remove is initiated, before the visual effect is finished, so
2005 Dec 28
1
RJS and :loading
Hi, I''m a newbie with Ajax and RJS and have one basic question. When contents in .rjs are exceuted in a Ajax sequence? .rjs seems a kind of alternate for .rhtml view file, so I guess they are in action after the controller action completed. The contents of .rjs file are :complete scenario, right? if so, can''t I write some on :loading action in .rjs? like disabling
2008 Mar 17
9
Render index view and RJS on load?
Hi, I''ve searched for a while online and been unable to find anything concerning this. I have a controller with an index action, which has an index view. This view renders the index page but also needs to execute some javascript to show some data (using effects) when the page loads. I thought I could just create the view and RJS with the same name and the RJS would be run after the
2007 Apr 04
2
Simple RJS Calls Not Working
I have a simlple view: <h2>Tags</h2> <% unless @recipe.tags.empty? %> <table> <tbody id="tags"> <%= render :partial=>''tags/tag'', :collection=>@recipe.tags %> </tbody> </table> <% end %> <% form_remote_tag :url=>tags_path(@recipe) do%>
2006 Jan 13
1
Rendering an RJS template within another RJS template
Is there a way to render an RJS template within another? I''ve put my simplified code below. No errors are generated, but the partial isn''t rendered. I also tried using render :action => ''update_actions'' destroy.rjs--- page.visual_effect :fade, comment_container(@object.id.to_s) # update the number of comments(below is another rjs template) render :partial
2006 Sep 06
2
RJS Javascript oddity - trying to call Element.setStyle
Hi all, I have a really simple web page. Right now, it''s just a button and a square div. What I want to do is to change the background color of the div to red when the button is clicked. My form code looks like this: <%= form_remote_tag :url => {:action => ''color_show''} %> color_show.rjs looks like this: page <<
2009 Jul 24
5
padawan seeks advice from jedi masters to create toggle box via ajax/rjs before slitting wrists with ruby powered light-saber.
I AM TRYING TO MAKE A DAMN TOGGLE BOX, BUT USING MY OWN GRAPHIC AND HAVING THE MOUSECLICK TRIGGER BOTH SWITCHING THE GRAPHIC (via AJAX) AND SAVING THE STATE IN THE DATABASE. I GOT IT ALL WORKING WITH NORMAL HTML GET CALLS TO THE SERVER, BUT I NEED IT TO BE AJAXIFIED SO THAT THE PAGE DOESN''T RELOAD. AND TO COMPLICATE MATTERS, IT HAS TO WORK IN A TABLE WITH AN ARBITRARY NUMBER OF ENTRIES,
2006 Aug 07
2
.rjs not run unless I manually set the Content-type header
I''ve got this is my controller def destroy @headers[''Content-Type''] = ''text/javascript; charset=utf-8'' end and this in my .rjs file called destroy.rjs page.alert(''test'') page.visual_effect :shrink, ''tip_''+params[:id], :duration => 3 This works, *unless* I uncomment the Content-Type line in the