Thursday, September 25, 2014

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

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 learned that "load()" can do ajax calls for you, this might work:

$("#popup").dialog({modal: true}).dialog('open')).load(this.href)

I've updated my 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, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cf745121-1ed2-4c89-9c90-3c6d00c37505%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment