Trying to use UI Dialog with .data and dialog.width, dialog.height
Hi there,
I am using the jQuery UI 1.5 Dialog and have run across a problem
trying to dynamically set the width and height of these boxes.
Currently my code receives HTML from an AJAX call and then creates a
div, appends the div to the body, fills the div with teh HTML and then
calls dialog on this div.
Here is the call :
form = $('<div class="holder"></div>');
$("body").append(form);
form.html(data).dialog({
autoOpen : false,
width : 700,
height : 450,
overlay : {
opacity : 0.5,
background : "black"
},
dialogClass : "jqmDialog"
}).parents(".ui-dialog:first").find(".ui-dialog-titlebar-
close").hide();
form.find('.jqmClose').click(function() {form.dialog('destroy');
form.remove();});
inside the HTML is a handler for .ajaxSuccess and this then triggers
the dialog to be opened, however I would also like to set the height
and width of teh dialog from inside this handler too. This doesn't
seem to work.
Here is what I am trying to do :
$('#billform').parents('.holder:first').data('width.dialog', 400);
$('#billform').parents('.holder:first').dialog('open');
#billform is the div that comes back from the AJAX call that contains
everything so #billform.parents('.holder:first') should be the div
that dialog() was called on. It seems this is true as when I used the
dialog('open') call the dialog appears with all the settings I have
from the init.
I just can't seem to get any of the options to work from this handler
I've tried modal, height and width and none of them seem to alter the
state of the dialog, yet they are operating on the same element as the
open call.
Can anyone shed any light on this ?
Thanks