Hi all, I have a web with a table which list the values of a model and I want to add a toolbar for edit, show and delete a row. I have added OnClick event that calls a JavaScript method to highligth the selected row and I want to get the ID of that selected row to pass to the buttons (each button have a Link_to) in the toolbar to launch the action to the ID selected. Somebody knows how can I do this? Thanks in advance for your help Lexor -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Jul 15, 2008 at 1:53 AM, Lexor Man <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have added OnClick event that calls a JavaScript method to highligth > the selected row and I want to get the ID of that selected row to pass > to the buttons (each button have a Link_to) in the toolbar to launch the > action to the ID selected. > > Somebody knows how can I do this?Do what? If you have an onclick event handler already configured, you have the event target object -- if that''s not the selected row, then it must have some relationship to the row. IOW, you''re changing the style (or className, or something) of the row -- so you already have access to the object (row) id. Unless I haven''t had enough coffee and totally misunderstand :-) FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder wrote:> On Tue, Jul 15, 2008 at 1:53 AM, Lexor Man > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> I have added OnClick event that calls a JavaScript method to highligth >> the selected row and I want to get the ID of that selected row to pass >> to the buttons (each button have a Link_to) in the toolbar to launch the >> action to the ID selected. >> >> Somebody knows how can I do this? > > Do what? If you have an onclick event handler already configured, > you have the event target object -- if that''s not the selected row, then > it must have some relationship to the row. > > IOW, you''re changing the style (or className, or something) of the > row -- so you already have access to the object (row) id. > > Unless I haven''t had enough coffee and totally misunderstand :-) > > FWIW, > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.orgHi Hassan, Thanks for your reply, but nevermind, I decided to do other stuff. Thanks and Regards Lexor -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---