why does jquery dialog() auto height, width fail? -


i using jquery pop dialogure

 var div = $('#mditem_temp');  var dlg = $(div).html(data).dialog({                         height: 'auto',                         width: 'auto',                         modal: true,                         show: "drop",                         hide: "fold",                         position: "top",                         autoresize:true,                         close: function (event, ui) {                             $("#mditem_temp").dialog('close');                         },                         buttons: {                             'add': function (d) {                                 pqr();                                  $(this).dialog('close');                                 $("#mditem_temp").dialog('close');                              }                         }                     }).dialog('open'); 

and data write in partial view, pop not adjust height width data. may reason?

this caused fixed height/width or display issue in data variable. inspect rendered partial in firebug or similar tool , see if it's rendering outside dialog's contained area. if it's not it's size of data html causing issue.

another option, of course, dynamically set dialog's height on each opening:

$(div).html(data).dialog({   ...   open: function(){     var height = [calculate height js];     $(this).height(height);   } }); 

Comments