Hi all... I have a tabbed interface for showing the details of an Item. By default the ''Details'' tab is selected. The code for displaying each tab is in a partial file. In one tab named ''status'', i''m showing the list of status history of that item. I am trying to implement pagination for this list. When i click on the ''next'' link to view the next page, the entire page get reloaded and return to ''Details'' tab which is selected by default. I just want to display the next page in the ''status'' tab without reloading. How can i do this? Please help. Thanks in advance Suneeta -- 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 -~----------~----~----~----~------~----~------~--~---
Hi, By default, the link tag will post the page. In your case, the pagination value (i.e.) the page number will be sent by GET method. I hope you can see the page variable in the URL. Coming to your problem, i am sure you should have some flag variable to differentiate between each tabs. So try to post (POST or GET method) that variable through java script from the Link tag. Hope it resolves your problem. Regards, VASANTH Suneeta Km wrote:> Hi all... > > I have a tabbed interface for showing the details of an Item. By > default the ''Details'' tab is selected. The code for displaying each tab > is in a partial file. > > In one tab named ''status'', i''m showing the list of status history of > that item. I am trying to implement pagination for this list. > When i click on the ''next'' link to view the next page, the entire page > get reloaded and return to ''Details'' tab which is selected by default. I > just want to display the next page in the ''status'' tab without > reloading. > > How can i do this? Please help. > > Thanks in advance > Suneeta-- 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 -~----------~----~----~----~------~----~------~--~---
Hi, The link tag are: <table class=''paginationtable'' align=''right''> <tr align=''center''> <td> <%= link_to(''Previous'', {:params => params.merge(''page'' => @hardware_ci_status_histories_pages.current.previous)}) if @hardware_ci_status_histories_pages.current.previous %> <%= pagination_links(@hardware_ci_status_histories_pages,{:params => params.merge(''ci''=>@ci.id)}) %> <%= '''' if @hardware_ci_status_histories_pages.current.previous and @hardware_ci_status_histories_pages.current.next %> <%= link_to(''Next'', {:params => params.merge(''page'' => @hardware_ci_status_histories_pages.current.next)}) if @hardware_ci_status_histories_pages.current.next %> </td> </tr> </table> I have an id for differentiating each tab. The id for the ''status'' tab is ''cistatushistory''. Can you please show me how to pass this id through javascript from the link tag? Thank you for your reply Regards Suneeta Vasanthakumar Csk wrote:> Hi, > By default, the link tag will post the page. In your case, the > pagination value (i.e.) the page number will be sent by GET method. I > hope you can see the page variable in the URL. > Coming to your problem, i am sure you should have some flag variable to > differentiate between each tabs. So try to post (POST or GET method) > that variable through java script from the Link tag. > Hope it resolves your problem. > > Regards, > VASANTH > > Suneeta Km wrote: >> Hi all... >> >> I have a tabbed interface for showing the details of an Item. By >> default the ''Details'' tab is selected. The code for displaying each tab >> is in a partial file. >> >> In one tab named ''status'', i''m showing the list of status history of >> that item. I am trying to implement pagination for this list. >> When i click on the ''next'' link to view the next page, the entire page >> get reloaded and return to ''Details'' tab which is selected by default. I >> just want to display the next page in the ''status'' tab without >> reloading. >> >> How can i do this? Please help. >> >> Thanks in advance >> Suneeta-- 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 -~----------~----~----~----~------~----~------~--~---
Hi, Try this ":params => params.merge(''ci''=>@ci.id,''id''=>''cistatushistory'')" inside the Link tag. Regards, Vasanth Suneeta Km wrote:> Hi, > > The link tag are: > > <table class=''paginationtable'' align=''right''> > <tr align=''center''> > <td> > <%= link_to(''Previous'', {:params => params.merge(''page'' => > @hardware_ci_status_histories_pages.current.previous)}) if > @hardware_ci_status_histories_pages.current.previous %> > <%= pagination_links(@hardware_ci_status_histories_pages,{:params > => params.merge(''ci''=>@ci.id)}) %> > <%= '''' if @hardware_ci_status_histories_pages.current.previous and > @hardware_ci_status_histories_pages.current.next %> > <%= link_to(''Next'', {:params => params.merge(''page'' => > @hardware_ci_status_histories_pages.current.next)}) if > @hardware_ci_status_histories_pages.current.next %> > </td> > </tr> > </table> > > I have an id for differentiating each tab. The id for the ''status'' tab > is ''cistatushistory''. Can you please show me how to pass this id through > javascript from the link tag? > > Thank you for your reply > Regards > Suneeta > >-- 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 -~----------~----~----~----~------~----~------~--~---
Hi, Thank you so much for your reply. I tried giving the id as parameter. But it didn''t show any diference. When we click on the ''next'' link the page is reloaded and the ''Detail'' tab is selected. Should I use ajax calls here inorder to prevent the page from being reloaded? Any idea about this? Regards Suneeta Vasanthakumar Csk wrote:> Hi, > Try this > ":params => params.merge(''ci''=>@ci.id,''id''=>''cistatushistory'')" > inside the Link tag. > > Regards, > Vasanth >-- 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 -~----------~----~----~----~------~----~------~--~---
Suneeta Km wrote: Hi, Thank you so much for your reply. I tried giving the id as parameter. But it didn''t show any diference. When we click on the ''next'' link the page is reloaded and the ''Detail'' tab is selected. With this id what are the operations to be made? Should I use ajax calls here inorder to prevent the page from being reloaded? Any idea about this? Regards Suneeta> Vasanthakumar Csk wrote: >> Hi, >> Try this >> ":params => params.merge(''ci''=>@ci.id,''id''=>''cistatushistory'')" >> inside the Link tag. >> >> Regards, >> Vasanth >>-- 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 -~----------~----~----~----~------~----~------~--~---
Hi, In the onclick event of the tabs you will pass some variable right? Either to normal posting methods or AJAX calls. I suppose that variable would be "id". If thats the case then use this condition before passing to posting methods or AJAX calls, if(params[:id]) id = params[:id] # so ur ''cistatushistory'' will be stored in ''id'' end Regards, VASANTH Suneeta Km wrote:> Suneeta Km wrote: > Hi, > Thank you so much for your reply. I tried giving the id as parameter. > But it didn''t show any diference. When we click on the ''next'' link > the > page is reloaded and the ''Detail'' tab is selected. > With this id what are the operations to be made? > Should I use ajax calls here inorder to prevent the page from being > reloaded? > Any idea about this? > > Regards > Suneeta >-- 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 -~----------~----~----~----~------~----~------~--~---
There is a very interesting discussion of tabs in Rails located here: http://www.therailsway.com/2007/6/28/free-for-all-tab-helper-summary On Mar 5, 5:21 am, Suneeta Km <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all... > > I have a tabbed interface for showing the details of an Item. By > default the ''Details'' tab is selected. The code for displaying each tab > is in a partial file. > > In one tab named ''status'', i''m showing the list of status history of > that item. I am trying to implement pagination for this list. > When i click on the ''next'' link to view the next page, the entire page > get reloaded and return to ''Details'' tab which is selected by default. I > just want to display the next page in the ''status'' tab without > reloading. > > How can i do this? Please help. > > Thanks in advance > Suneeta > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---