dojo addOnLoad/ready does not work with dialogs -
so appears dojo.addonload , dojo.ready functions not apply dialogs.
i looking alternatives. trouble dialog html dynamically created , contains many different script blocks each using dojo.connect function add functionality. example, have:
<input type='checkbox' name='value(liquid40011252)' value='1' dojotype='dijit.form.checkbox' id='liquid4001125249' /> <script type='text/javascript'>dojo.addonload(function() { dialogconnect4001125249();}); function dialogconnect4001125249() { dojo.connect(dijit.byid('liquid4001125249'), 'onchange', function(){ // code toggling checkboxes ets }); } </script> this works fine in normal webpage dialog addonload not respected , dijit.byid('liquid4001125249') undefined. ready not help.
i instantiate dialog with
searchdlg = dojox.widget.dialogsimple(); searchdlg.set("title", title); searchdlg.set("style", "width: " + width + "px; max-height: "+height+"px; overflow:auto;"); searchdlg.set("content", content); searchdlg.show(); and considered calling dialogconnect after show there many dialogconnectxxxxx , not have list.
perhaps alternative somehow add list of dialogconnects somewhere - perhaps on dialog itself. not sure.
any ideas on how solve complex problem?
in case, dialogs exist after searchdlg... code executed. normal dijit.byid not find them in addonload routine.
i don't know wanna in connectdialog functions think gain in readability subclassing dialog , use postcreate method connect dialog.
dojo.declare("mynamespace.mycustomdialog", [dijit.dialog], { templatestring: dojo.cache("mynamespace", "templates/mycustomdialog.html"), widgetsintemplate: true, postcreate: function() { // whatever dojo.connect need }, });
Comments
Post a Comment