I create a jQuery dialog in the usual way, $('#MyDlg').dialog(...), and display it. In some other function I want to close it, so I do $('#MyDlg').dialog('close'), but nothing happens.
After some testing I found that if I save the object reference from dialog creation, make it available to the other function, and call dialog('close') on it, the dialog does close as expected.
Isn't is supposed to work the way I tried first? Or am I missing something?
MyDlgid attribute?