Gaining Reference to the Dialog from Dialog content
- by coffeeaddict
Here's my scenario:
I've got a div on Page A.
When an event happens (whatever I define, a click, whatever), I do a div.Dialog, set its properties and open it
The data inside is returned from an async .ajax call that grabs the data from a url and appends it to the div by calling div.html(data) inside the .ajax callback, so it's essentially loading a PageB by getting the data (content) and appending it to the div that's calling the dialog("open")...nothing special here I don't think.
My question: In Page B, how do I reference the dialog so I can do some things to it? For instance in Page B's content that I received back from that .ajax call and added to the div via .html(data), there is a button and when clicked I need to close the dialog.
Right now my buttons are not working because one of them closes out the dialog and the other should redirect to a new page but both do not work now because I have no reference to the dialog that it's in to manipulate it.