下面显示的代码工作正常。我正在尝试将对话框部分(GBBSO.cnst.ddlog.dialog 行)移动到 GBBSO.cnst 代码块中,并且遇到各种错误 - 语法、未定义函数等。这可能吗?
if (GBBSO == null || typeof (GBBSO) != "object") { var GBBSO = new Object(); }
GBBSO.cnst = {
datePickerOpt1: {
dateFormat: 'dd-M-yy',
showOn: 'button',
buttonImage: 'Styles/Images/Calendar_scheduleHS.png',
buttonImageOnly: true,
buttonText: 'Select a date',
showButtonPanel: true,
changeMonth: 'true',
changeYear: 'true',
beforeShow: function (input) { GBBSO.dpClearButton(input); },
onChangeMonthYear: function (yy, mm, inst) { GBBSO.dpClearButton(inst.input); }
},
ddlog: jQuery('<div><span><img src="Global_Template_Files/Images/loading.gif" /> Communicating with the server....</span></div>')
}
GBBSO.cnst.ddlog.dialog({ autoOpen: false, resizable: false, modal: true, width: 400, height: 100, closeOnEscape: false, show: 'drop', hide: 'drop',
open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); }
});
GBBSO.cnst.ddlog.dialog('open');
下面显示的代码不起作用。我在打开时收到“预期功能”错误。
GBBSO.cnst = {
datePickerOpt1: {
dateFormat: 'dd-M-yy',
showOn: 'button',
buttonImage: 'Styles/Images/Calendar_scheduleHS.png',
buttonImageOnly: true,
buttonText: 'Select a date',
showButtonPanel: true,
changeMonth: 'true',
changeYear: 'true',
beforeShow: function (input) { GBBSO.dpClearButton(input); },
onChangeMonthYear: function (yy, mm, inst) { GBBSO.dpClearButton(inst.input); }
},
ddlog: {
html: jQuery('<div><span><img src="Global_Template_Files/Images/loading.gif" /> Communicating with the server....</span></div>'),
dialog: { autoOpen: false, resizable: false, modal: true, width: 400, height: 100, closeOnEscape: false, show: 'drop', hide: 'drop',
open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); }
}
}
}
GBBSO.cnst.ddlog.dialog(GBBSO.cnst.ddlog.dialog);
GBBSO.cnst.ddlog.dialog('open');