Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery-UI Dialog Container goes missing

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I call the above function on the click event of a button. It displays a form in a dialog (#dialog-form). After closing the form the dialog won't open when this function is called subsequent times. Looking at the console.log() statements, it always finds the $(tab) but the #dialog-form comes back empty. To make matters worse, it is sporadic. The other day, this was working just fine. I could get the dialog to display any time I wanted. Today? Only once.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A tad bit more information. $(tab) is looking for the ID of a jQuery UI tab element, and on this tab I have the DIV#dialog-form. In firebug, I can type console.log($('#dialog-form')) and I get my DIV element back. If I do a search off the $(tab) it comes back []. This only occurs after I've dismissed the dialog the first time. Prior to showing the dialog, I can find the element no problem.

My guess is that when the Dialog is closed, the DIV#dialog-form isn't a child of $(tab) anymore.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<off-topic>
    I can't help. At the same time, I'm amused enough I have to post *something*, because stuff like this, DOM/JavaScript interaction, cracks me up, in the way that makes me want to stick my head in an oven and long for a more unified, sane model.
</off-topic>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic