I got a div tag which initially is set to have display:none and will later be convert into a dialog:
@* To load the create dialog *@
<div id="createdialog">
</div>
我把部分观点带入了方言中:
// Dialog for create food
var controllerUrl = /Food/CreateFood ;
$( #createdialog ).append($( #loading ));
var $createdialog = $( #createdialog ).load(controllerUrl).dialog({
autoOpen: false,
title: Create Food ,
modal: true,
// To set the dialog width to full width
width: auto ,
// Call the clear function without ()
close: clear
});
And then i open it inside the jquery ui drop event once user drop something:
$.validator.unobtrusive.parse($createdialog);
$createdialog.dialog( open );
So it means that my dialog is actually created on demand, so I cant pre-load the dialog content. I need to display a loading image and hide it once everything is done loaded in the dialog. But I just cant get it work...Hope can get some help here....
赞赏任何反馈...... ......