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

2014-09-29 Thread Collin Anderson
I have a jsfiddle working with my code. http://jsfiddle.net/mafos5ox/1/ Do any errors show up in the developer tools console? -- 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,

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

2014-09-26 Thread Kamal Kaur
On Fri, Sep 26, 2014 at 10:40 PM, Collin Anderson wrote: > Ahh yup. I should really test my examples :) Indeed! > The SyntaxError will make the > even handler not register. Does removing the extra parentheses fix it? No. In fact, I got the content in next page only after

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

2014-09-26 Thread Collin Anderson
Ahh yup. I should really test my examples :) The SyntaxError will make the even handler not register. Does removing the extra parentheses fix it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

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

2014-09-26 Thread Kamal Kaur
On Fri, Sep 26, 2014 at 1:49 AM, Collin Anderson wrote: > $("#popup").dialog({modal: true}).dialog('open')).load(this.href) > > I've updated my blog post. This is opening the template on next page :/ And you need to edit the post: $("#popup").dialog({modal:

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

2014-09-25 Thread Collin Anderson
I figured it out. html() isn't chainable. It needs to be one of these: $.get(this.href, function(data){ $("#popup").html(data) $("#popup").dialog({modal: true}).dialog('open') }) or $.get(this.href, function(data){ $("#popup").dialog({modal: true}).dialog('open').html(data) }) or, after I

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

2014-09-24 Thread Fred Stluka
Excellent! Thanks! Now I can just point my team at it, instead of writing out the details myself. --Fred Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ Bristle Software, Inc -- http://bristle.com --

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

2014-09-24 Thread Collin Anderson
Here's the blog post, by popular demand :) http://collincode.wordpress.com/2014/09/24/jquery-ui-popup-with-django-backend/ -- 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

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

2014-09-24 Thread Collin Anderson
I think you only included the "jquery" script code. You need to include both jquery and jqueryui. I'll work on the blog post. -- 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,

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

2014-09-24 Thread Kamal Kaur
On Thu, Sep 25, 2014 at 12:10 AM, Jan Eskilsson wrote: > "Uncaught TypeError: Undef is not a function" error in the Java Script, dont > understand why really ? Yes, I get the same in Chromium (y) ​,​ but only after reopening, as I mentioned in

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

2014-09-24 Thread Kamal Kaur
On Tue, Sep 23, 2014 at 11:17 PM, Fred Stluka wrote: > > Excellent sample. Thanks! That's a nice standalone summary > of how to do a popup dialog via jQuery and Ajax. Worth posting > to a tips page or blog if you have such, so other people can > Google it. @ Collin, please

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

2014-09-24 Thread Jan Eskilsson
Sorry for budging in but for me this works $("#dialog-form").html(data) rather than load(data) but I get a "Uncaught TypeError: Undef is not a function" error in the Java Script, dont understand why really ? Thank You in Advance Jan Eskilsson 2014-09-24 22:05 GMT+04:00 Collin Anderson

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

2014-09-24 Thread Collin Anderson
Interesting. Maybe it should be $("#dialog-form").html(data) rather than load(data) -- 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

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

2014-09-24 Thread Kamal Kaur
On Tue, Sep 23, 2014 at 6:14 PM, Collin Anderson wrote: > # popupadvance.html > Here's the worker object: {{ worker }} > src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"> > > Advance > What I see is that I need to write the contents to be shown,

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

2014-09-24 Thread Kamal Kaur
On Wed, Sep 24, 2014 at 8:01 PM, Collin Anderson wrote: > Hmm... it seems to be trying to parse your html as javascript. Try using > adding to your $.ajax(): > > dataType: 'text', Nothing happened. -- Kamaljeet Kaur kamalkaur188.wordpress.com -- You received this

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

2014-09-24 Thread Collin Anderson
Hmm... it seems to be trying to parse your html as javascript. Try using adding to your $.ajax(): dataType: 'text', -- 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

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

2014-09-24 Thread Kamal Kaur
On Tue, Sep 23, 2014 at 11:17 PM, Fred Stluka wrote: > Kamal, does this fill in the gaps for you? If not, let us know. I've used this example in my app and getting this, in Firefox console, on clicking the link: http://pastie.org/9590027 Here is what I get as output:

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

2014-09-23 Thread Fred Stluka
Collin, Excellent sample. Thanks! That's a nice standalone summary of how to do a popup dialog via jQuery and Ajax. Worth posting to a tips page or blog if you have such, so other people can Google it. Kamal, does this fill in the gaps for you? If not, let us know. --Fred

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

2014-09-23 Thread Collin Anderson
# popupadvance.html Here's the worker object: {{ worker }} # views.py def popupadvance(request): worker = Worker.objects.get(id=request.GET.get('worker_id') return render(request, 'popupadvance.html', {'worker': worker}) # urls.py from . import views urlpatterns = [

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

2014-09-22 Thread Kamal Kaur
On Mon, Sep 22, 2014 at 9:14 PM, Collin Anderson wrote: > What happens when you try? I'm not getting how to tell AJAX to go to a view and load the data that it returns as the template, (in dialog). It's just not done. Feeling too dumb to use it. And doesn't work when I send

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

2014-09-22 Thread Fred Stluka
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

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

2014-09-22 Thread Collin Anderson
> > 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 > What happens when you try? -- You received this message because you are subscribed to the Google Groups "Django

Open Django template in dialog box (not in window)

2014-09-21 Thread Kamal Kaur
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: