dialog issues - accessing the dialog object, scrolling inside the container...

dialog issues - accessing the dialog object, scrolling inside the container...


Hello,
I'm having some troubles getting going with the ui.dialog widget. I'm
using it to display content that often extends beyond the bounds of
the dialog. I've tried putting the content in a div with
overflow:auto, and creating a dialog from that div element, but I
still need to resize the height of the div element to match the dialog
when it is opened/resized. Here's what I have at the moment, which
resizes the contained div based on the dimensions of the elements
within the dialog on resize/open callbacks:
var d = $('<div style="overflow:auto;">lots of stuff here</
div>');
    d.dialog({title:"Overflowing",width:350,height:
250,modal:true,autoOpen:false,
        overlay:{backgroundColor:"white",opacity:.3},
        resize:function()
        {
            d.height($(this).height() -
            $(this).find(".ui-dialog-titlebar").height() -
            $(this).find(".ui-resizable-s").height());
        },
        open:function()
        {
            d.height($(this).height() -
            $(this).find(".ui-dialog-titlebar").height() -
            $(this).find(".ui-resizable-s").height());
        }
    });
This seems to work for the resize callback will resize the height of
the div to match the dialog as it is resized, but the open callback
seems to do nothing. So when the dialog first opens, overflowed
content is simply hidden, until I resize the dialog and the div I
inserted into it gets its hight reset on the resize callback.
This led me to a more general issue that I have - I was going to try
to setting the height of the div after I instantiated or opened the
dialog (like with the open callback, but on a separate line after
calling d.dialog()). At this point, I realized that I don't have an
easy way to actually reference the dialog object itself - how can I
get access to the actual ui-dialog div, and all of its sub-elements
that surround the content?
Thanks for any suggestions.
mgl