I was looking for something like this for CBVs about a week ago! I'm glad this guy posted this question more clearly than mine to get this response. I might try this out! Thanks. This is a very common pattern, I've found, and wasn't sure why it wasn't included in django's core!
On Thursday, February 14, 2013 6:30:27 AM UTC-7, Felipe 'chronos' Prenholato wrote: > > I use bootstrap modal with some jquery code. > > jQuery code isnt hard, on Django side what you need is special treatment > for ajax call so you can render template for form (and only form), so you > can load it into modal. > > Fortunately I wrote a AjaxUpdateView yesterday. It is in beta, but check > at > https://github.com/chronossc/django-cbv-utils/blob/4d992533925e4bc2e215cbfa8e98d07853d65784/cbv_utils/views.py#L152 > ... > you will see in form_valid and form_invalid methods that I render the form > and return with JSON in response to ajax request. > > Here is html files and jquery code used with this view: > https://gist.github.com/chronossc/4952775 ... consider it a example :) > > > > Felipe 'chronos' Prenholato. > Linux User nº 405489 > Home page: http://devwithpassion.com | http://chronosbox.org/blog > GitHub: http://github.com/chronossc/ | Twitter: > http://twitter.com/chronossc > > > 2013/2/13 <[email protected] <javascript:>> > >> ** >> Probably the easiest way is to use a JS/CSS framework that has a good >> support for popups and forms. There are a lot out there. I have personal >> experience with Bootstrap (one of the most popular these days) - check its >> documentation (look for both "popup" and "modal"), also search for >> available bootstrap plugins - plenty exist. >> >> If you wanted to stick with jQuery, check out jQuery UI - a set of >> reusable components that might suit your needs. >> >> HTH >> >> Jirka >> ------------------------------ >> *From: * frocco <[email protected] <javascript:>> >> *Sender: * [email protected] <javascript:> >> *Date: *Wed, 13 Feb 2013 11:35:36 -0800 (PST) >> *To: *<[email protected] <javascript:>> >> *ReplyTo: * [email protected] <javascript:> >> *Cc: *<[email protected] <javascript:>> >> *Subject: *Re: Is there an easy way to popup forms? >> >> Thanks Tom, >> >> Do you know how I would have a form display using this? >> >> >> On Wednesday, February 13, 2013 11:41:59 AM UTC-5, Tom Evans wrote: >>> >>> On Wed, Feb 13, 2013 at 4:12 PM, frocco <[email protected]> wrote: >>> > I have a form I want to popup and am having trouble getting this to >>> work. >>> > This is not in the admin page. >>> > >>> > Can someone give me an example? >>> > >>> > Thanks >>> > >>> >>> An easy way to do a pop up form is to use a jqueryui dialog¹ >>> >>> http://api.jqueryui.com/**dialog/ <http://api.jqueryui.com/dialog/> >>> >>> Cheers >>> >>> Tom >>> >>> ¹ Other dialogs are available, consult your local google >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/django-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/django-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

