javascript - Cannot code jQuery UI dialog into a namespace -
the code shown below works fine. trying move dialog portion (gbbso.cnst.ddlog.dialog line) gbbso.cnst code block , i'm running kinds of errors - syntax, function not defined, etc. possible do?
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 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 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');
the code shown below not work. receive 'function expected' error on open.
gbbso.cnst = { datepickeropt1: { dateformat: 'dd-m-yy', showon: 'button', buttonimage: 'styles/images/calendar_schedulehs.png', buttonimageonly: true, buttontext: 'select 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 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');
second example works if dialog function setup correctly. modified second example fix code , make 'dialog' less confusing. (thanks spyk3hh)
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 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 server....</span></div>'), dialogattrs: { 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.html.dialog(gbbso.cnst.ddlog.dialogattrs); gbbso.cnst.ddlog.html.dialog('open');
Comments
Post a Comment