jQueryダイアログでhtmlページをロードしますが、閉じるボタンを使用してダイアログを閉じ、再度ダイアログを開くと、次のエラーが発生します:
Error: cannot call methods on dialogue prior to initialization; attempted to call method 'isOpen'
私のコード
$("#enterRunnerPositionDialog").dialog({
autoOpen: false,
position: 'center',
title: 'Enter Runner Position Selection',
draggable: false,
width: 1000,
height: 900,
resizable: false,
modal: true,
open: function (event, ui) {
var html = "";
$.ajax({
type: "GET",
url: "AdminController",
data: {
overlayScreenNo: 25,
objectName: 'horseNo'
},
success: function (response) {
var parseJSON = eval('(' + response + ')');
var success = parseJSON.success;
var status = parseJSON.status;
if (success == true && status == 200) {
displayRunner(parseJSON.result);
} else {
//alert(parseJSON.msg);
}
}
});
}
$("#enterRunnerPositionButton").click(function () {
$("#enterRunnerPositionDialog").load('runnerPositionSelection.html', function () {
//$("#enterRunnerPositionDialog").dialog("open");
});
if ($("#enterRunnerPositionDialog").dialog("isOpen")) {} else $("#enterRunnerPositionDialog").dialog("open");
});