On 13/10/10 08:14, Torbjorn wrote: > In my first shot > I got the tabs nice looking, one template for each tab and I can > navigate between the tabs, but, when I do something on a tab, for > instance posting a form, I would like to get back to that tab. How do > I do that? >
Well, django is server-side. When you say "one template for each tab and I can navigate between the tabs", there are several different ways to do that, and depending on how you've structured things somewhat different things might be appropriate. If you're using the tabs in "ajax mode" [1] (i.e. you have some toplevel django view that responds with a skeleton page including your tabs, and then when the client runs that page it does a bunch of ajax gets to further inner/partial django views that respond with the individual tab pane contents) then, well, the best thing to do is probably to use ajax to post your form too, in which case the user then wouldn't be doing a toplevel navigate away in the first place. There's a plugin which makes that really easy [2]. OTOH you might prefer working in whole-page terms in which case you can e.g. set a cookie to remember what tab was selected the last time the page was run [3]. [1] http://jqueryui.com/demos/tabs/#Ajax_mode [2] http://jquery.malsup.com/form/ [3] http://jqueryui.com/demos/tabs/#cookie -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.