Monday, September 22, 2014

Re: Open Django template in dialog box (not in window)

Kamal,

I do this via the jQueryUI "dialog" widget.  Works fine with Django
or any other back end code.  Just make an Ajax call to the URL
to get the HTML, instead of passing the URL to window.open(),
and pass the HTML to the jQuery dialog widget.

See:  http://jqueryui.com/dialog/

--Fred
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
On 9/21/14 5:16 AM, Kamal Kaur wrote:
I'm trying to open a Django template using JS as a popup. Actually  I've done this. But it opens a separate window but I want a clean  dialog box or simply a division instead of that window.    Using window.open method, clicking on the "Advance", "popitup"  function runs. Here's the code:  http://pastie.org/9580729    The popitup function takes the passed url and opens a window  containing template sent by the view. But how to open a dialog box  instead?    I've tried using AJAX, like told in the link below but yet unable to do:  http://stackoverflow.com/questions/19267531/how-to-open-jquery-ui-dialog-with-ajax-request      

No comments:

Post a Comment