similar to: RJS - Insert at top of table?

Displaying 20 results from an estimated 4000 matches similar to: "RJS - Insert at top of table?"

2006 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in the helper below (everything was in the controller). I can successfully create a new link but I get a TypeError when I leave all form fields blank -- I expect to see validation error messages. --- #link_controller.rb: def create link = Link.new(params[:link]) saved = link.save num_links = Link.find(:all).size
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 Aug 02
9
RJS not cross browser compatible?
I have an RJS template that does the following page.insert_html :bottom, "some_id", ''<tr id="some_id"><td></td></tr>'' This works just find in safari and firefox. In IE and Opera it doesn''t work so great. Any ideas? Am I doing something wrong here? -- Posted via http://www.ruby-forum.com/.
2006 May 02
1
Very simple RJS not working in IE
My HTML: <div id="search_div" style="display: none;"> <table> <tbody id=''search_results''> </tbody> </table> </div> My RJS: page.insert_html :bottom, ''search_results'', "<tr><td>Test</td></tr>" page.show "search_div" Now, everytime this gets called, it adds a
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 Mar 08
4
ajax with tables
There may be an easy solution, but I just can''t seem to get this to work... I''m using tables for part of my site, as they contain a lot of rows and columns full of financial data, so just working with div''s and dd''s... etc, won''t do. My table structure is pretty simple, as follows: ================= <table id="items"> <tr>
2006 Apr 05
2
RJS and remote forms
I''ve run into what I think is a browser bug related to using remote_forms pushed in an RJS update. In my controller, I have an action that creates a new model and returns a form for one of its children: def create_party party = Party.create render :update do |page| page.insert_html :top, ''party-list'', :partial => ''party_header'',
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a list of projects: page.replace_html ''results'', ''<div>'' @projects.each do |p| page.insert_html :bottom, ''results'', p.name + "<br/>" end page.insert_html :bottom, ''searchresults'', ''</div>'' page.show
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 ..................
2008 Sep 22
3
syntax error in RJS
I''m new to Ruby on Rails and came across a problem I could not solve alone. I''ve a pretty simple RJS file that looks like the following: 3.times do page.insert_html :bottom, ''messages'', ''test'' end page.call ''updateMessageWindow'' However this snippet gives a syntax error: ActionView::TemplateError (compile error D:/Eigene
2007 Mar 25
5
Insert text into text area field with RJS
Hi, I''d like to insert/append some default text into a text area after clicking on an image button ''test.png'' in edit.rhtml: <%= link_to image_tag("test.png"), url => { :action => :new_text } %> Action: # article_body is the textarea''s id. def new_text render :update do |page| page.insert_html :bottom, :article_body,
2006 Apr 09
4
Best RJS process for what I''m trying to do...
I just wanted to ping this off the list to get some advice since I''m now pulling my hair out. Thanks in advance for taking any time to look at this. It''s much appreciated. Now, my problem is my RJS is working but it''s not inserting how I want it to insert. I have a partial I''m rendering in my view that looks like this: <ul
2006 May 08
3
Can you apply effects to elements create in same RJS file?
I am trying to create a new element in a list and highlight it. I am doing the following in my rjs file: page.insert_html :after, ''bananalist_header'', :partial => ''banana'' page.visual_effect :highlight, "banana#{banana.id}", :duration => 1 The first line creates a new element with the id= ''banana3'' say... The second line then
2006 Jul 19
3
render :partial inserting new line in RJS
Struggling a bit with rendering a partial in an RJS template. I''m having to feed the javascript directly to the page object as couldn''t find a way to have insert_html work directly on the proxy object returned by select. However, that''s not the problem. The code for doing that is below and it all works fine, except that a new line is being inserted after the
2006 Jun 27
5
RJS -- What am I missing?
This is driving me nuts:-) I''ve brought it down to a simplified case where I''m rendering this rjs template: page.insert_html :top, ''cat1'', "<li>Some list item</li>" According to FireBug, this is what I''m actually getting in the browser: try { new Insertion.Top("cat1", "<li>Some list
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 :
2009 Aug 07
2
calling a jQuery function from RJS/onclick
Hi, I have the following jQuery function on the head of my page. <script type="text/javascript"> jQuery.noConflict(); /* calling jNice on document ready */ jQuery(document).ready(function($) { $(''div.jNice'').jNice(); }); ..... </script> On page load, this gets called correctly. Now there''s a link on the page that lets me add more
2006 Mar 03
1
rjs isn''t update_page problems
i have a list of, for example, meal_names. Basically, I can submit a name and the name I add shows up in the list.I had this working wehn i created an actual add.rjs template for it. So feeling good about my self, I attempted to move it all to the controller and use some update_page goodness. Now it the ajax middle doesn''t happen. I don''t get any errors but the list
2006 Apr 01
2
Inline RJS in controller
Inline RJS and Controller Hi guys, I really like the idea about inline RJS. I have about 20 rjs files for this 1 controller. They are small. Just updating and hiding some div''s. So to move this into my controller would clean up a lot. It makes sense because you see in the controller what you do. Question: 1. Any penalties for doing this? - size of controller increases - performance
2006 Jul 23
2
[OT] Ajax design question - breaking a table with text...
Hello everyone, I''ve got a table of data that looks like the following: ... <tr> <td>Field 1</td> <td>Field 2</td> <td><%= link_to "Info about Field 1", ... %></td> <td><%= link_to "Info about Field 2", ... %></td> </tr> I''d like the user to be able to click on "Info about