search for: javascriptgenerator

Displaying 20 results from an estimated 20 matches for "javascriptgenerator".

2006 Apr 20
4
JavaScriptGenerator Dead End
Hi All, I posted earlier about a problem I was having with the various remote view methods escaping all the javascript in my callbacks. I was quickly informed that that''s just what they do, and offered some workarounds. However, in actually working with this, I''m finding that this one little thing is forcing me to write some REALLY ugly code. Where I thought I could
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/.
2005 Dec 15
0
RJS Templates and the Replace semantics
...hat replaces the entire element in the DOM, similar to IE''s element.outerHTML: page.replace_html_element "thing-id", :partial => ''thing'' So, I''ve written an implementation of replace_html_element that comes in two parts: * The addition to the JavaScriptGenerator class to add a replace_html_element method * An update to the Prototype Element implementation to perform the client side update. Add this code to the Application.rb (or in a separate file required by Application.rb): # Update the JavaScriptGenerator to add our own functionality module Action...
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action, for example an .rhtml and a .rjs file to handle the view for the same action? I suspect not, but this makes me wonder if there a way to call the .rjs file from within the .rhtml so the statements within it get executed? Thanks, Andy
2006 Jun 30
6
using rjs
Hi I am relatively new to ruby on rails. I want to use this javascript bundle: http://prototype-window.xilinus.com/index.html How would I call those functions in an rjs file? example: win = new Window(''window_id'', {title: "Sample", top:100, left:350}) win.getContent().innerHTML = "<h1>Hello world !!</h1>"; win.setDestroyOnClose();
2006 Jun 27
4
RJS Form Values
Hi, I have the following code : <%=link_to_function("? | China", update_page{|page| page[''tags_en''].value = "China" page[''tags_ch''].value = "?" }) %> This updates two text fields with the China and ?. However I want to append the values, not replace them. So I need something like this :
2006 Feb 23
5
sortable_list added to by AJAX question
I have a working sortable_list that is added to by AJAX. The problem is that when a new item is added, it''s not sortable. I found a post on scriptaculous using behaviour.js to refresh the DOM when an item is added, but I can''t figure out how to do it with Rails. To test the behaviour method, I used this: var myrules={ ''div#steps ul'' :
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
2007 Feb 14
5
FormTestHelper should change hidden fields
Railsoids: FormTestHelper rules. It tests your response.body form at the same time as it triggers your action, with all the parameters in that form. This obviously improves quality. But it took issue with this: submit_form ''validate_stuff'' do |form| form[''IBhidden''] = ''validate'' end The field IBhidden is a hidden field. To be
2006 Aug 10
2
Is it possible for a controller to throw up a message box?
I need my controller to give some feedback to the user by popping up a message box. Does anyone have any ideas how this can be done? Thanks --John -- Posted via http://www.ruby-forum.com/.
2006 Jun 02
1
Ajax: update multiple DIV''s
Hello. Is it possible to update multiple DIVs during? For example I have DIV for @flash[:notice], and one for content and I need to render both DIVs after executing action.
2006 Apr 03
1
Q: periodically_call_remote ( how to make it execute just once? )
I posted this ealier on the web forums but noticed a similar question about this function and one user responded to try this list instead. If anyone can help I would greatly appreciate your suggestions. Q: Is there a way to use periodically_call_remote to run just one time instead of every '':frequency'' seconds? I tried putting the call inside the div container thinking it
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 Aug 18
3
RJS templates for DOM manipulation
I want to do some DOM manipulation with JavaScript. Specifically I want to implement zoom in/out in a picture by changing it''s width/height attributes. Is it possible to do this using RJS or should I write javascript by hand? All the examples of RJS I''ve seen write the javascript in the result of an AJAX remote call. Where are the docs for RJS? All I''ve seen are blog
2006 May 17
4
.rjs templates undesiered output problem
Hello everyone, I am working with rjs templates in rails, and I''m amazed of how simple it is to generate code with ajax, however I''am having some troubles and I can''t seem to find a way to solve''em. Whenever I put some code in the template, let''s say: page.visual_effect :highlight, ''sitio37'', :duration => 3 I get the
2008 Nov 22
3
RJS page.update question
How does page.update actually work? I know its a wrapper for Prototype.update but how does it get the partial in there? Say I wanted to update a div with the contents of a partial manually like this. content = render(:partial => ''whatever'') page.call "$(''my_div'').update(#{content})" But his does not work. It keeps giving me weird errors about
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 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 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 Mar 22
12
RJS page.replace(_html) problems
...ce instead results in correct display, but the div tag is lost then, so I can''t do further updates. Quote from the changelog for actionpack: Use Element.update(''id'', ''html'') instead of $(''id'').innerHTML = ''html'' in JavaScriptGenerator#replace_html so that script tags are evaluated. TIA - Bernd -- Posted via http://www.ruby-forum.com/.