I have some simple code that removes some table rows and works in Safari, Firefox, and IE (except for the fade effect): function remove_invoice_line(cell) { var data_row = Element.extend(cell).up(''tr''); var form_row = data_row.next(''tr''); form_row.remove(); Effect.Fade(data_row, {afterFinish: function () { data_row.remove() }}); } Nevertheless, if those rows are inserted dynamically, the same code fails in IE 6. I am using the Prototype that comes with Rails 1.2.2. Is this a known issue? Otherwise I would post the insertion code. -- fxn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Are the rows contained in a table or a tbody? IE seems to behave better when using a tbody. Colin fxn wrote:> I have some simple code that removes some table rows and works in > Safari, Firefox, and IE (except for the fade effect): > > function remove_invoice_line(cell) { > var data_row = Element.extend(cell).up(''tr''); > var form_row = data_row.next(''tr''); > form_row.remove(); > Effect.Fade(data_row, {afterFinish: function () > { data_row.remove() }}); > } > > Nevertheless, if those rows are inserted dynamically, the same code > fails in IE 6. I am using the Prototype that comes with Rails 1.2.2. > > Is this a known issue? Otherwise I would post the insertion code. > > -- fxn > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 21, 10:51 am, Colin Mollenhour <eliteii...-NPSFNn/7+NYVo650/ln6uw@public.gmane.org> wrote:> Are the rows contained in a table or a tbody? IE seems to behave better > when using a tbody.In browsers that conform to the HTML 4 specification, a table will always contain a tbody element, they are mandatory although the tags are not required in the source HTML. IE conforms in that regard. IE differs from other browsers when using DOM methods to add rows to a table[1]. It also fails if innerHTML is used in an attempt to insert rows. 1. <URL: http://developer.mozilla.org/en/docs/Gecko_DOM_Reference:Examples#Example_8:_Using_the_DOM_Table_Interface>-- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Sorry for the noise guys, problem was I didn''t know onclick didn''t work in IE if set with setAttribute (my JavaScript is pretty weak). Is there something I can do to get the appear/fade effect on table rows? -- fxn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 21, 5:45 pm, "fxn" <fxno...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sorry for the noise guys, problem was I didn''t know onclick didn''t > work in IE if set with setAttribute (my JavaScript is pretty weak).If you use Scriptaculous and Prototype, you will learn Prototype''s version of javascript which is quite different to "classic" javascript - you will learn very little about the underlying language. For example, presuming that "cell" refers to a TD element, your line: var data_row = Element.extend(cell).up(''tr''); can be replaced with: var data_row = cell.parentNode; which requires no additional libraries.> > Is there something I can do to get the appear/fade effect on table > rows?What fade effect would you like - do you want the row to fade, then the lower rows to slide up? Or both at once? How fast? -- Rob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 21, 10:49 am, "RobG" <r...-AFFH1GffN5hPR4JQBCEnsQ@public.gmane.org> wrote:> If you use Scriptaculous and Prototype, you will learn Prototype''s > version of javascript which is quite different to "classic" javascript > - you will learn very little about the underlying language. > > For example, presuming that "cell" refers to a TD element, your line: > > var data_row = Element.extend(cell).up(''tr''); > > can be replaced with: > > var data_row = cell.parentNode;Yeah, thank you! In that case I am in an anchor inside a TD. Going up with up(''tr'') seems more clear to me because I don''t care how many parents does that element have, I just want to get a reference to the enclosing row.> > Is there something I can do to get the appear/fade effect on table > > rows? > > What fade effect would you like - do you want the row to fade, then > the lower rows to slide up? Or both at once? How fast?This is a Rails application and I am using Prototype and script.aculo.us already. The code I use that works in Safari and Firefox but not in IE is: Effect.Fade(data_row, {afterFinish: function () { data_row.remove() }}); It would be enough to be able to emulate that. Since the row is effectively removed from the DOM the rest of the rows already slide up in the three browsers. It is just the fade effect that is not working in IE 6. The workaround I had in mind was to iterate over the text nodes in the cells and fade them (not tested), which would be your suggestion? -- fxn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---