I try to raise an event to all widgets that catch it. I have an authentication widget and other widgets that depend on the user logging in. I would like to raise an event to all of these widgets when the user is logged in without manually connecting them. How can I do that?
Try dojo.publish and dojo.subscribe
This may be the best link.
Here are some more detailed and up-to-date links to pub / sub in Dojo:
http://davidwalsh.name/dojo-pub-subhttp://startdojo.com/2010/05/21/decoupling-widget-to-widget-interaction-with-dojo/http://www.naelshawwa.com/dojo-how-to-publish-subscribe-2/
Docshttp://dojotoolkit.org/reference-guide/dojo/publish.htmlhttp://dojotoolkit.org/reference-guide/dojo/subscribe.htmlhttp://dojotoolkit.org/reference-guide/quickstart/events.html ( , )
- javascript , pub/sub - , .
dojo.subscribe("mytopic",console,"debug"); dojo.publish("mytopic",["whatever"]);
Source: https://habr.com/ru/post/1724740/More articles:Convert to dd / mmm / yyyy - phpDownloading problems in IE - cross-browserhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1724737/how-to-get-the-working-directory-after-performing-hg-convert-on-perforce-repository&usg=ALkJrhhtjdtzrBckHxgDqVXw1v3ZDLhgFwhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1724738/can-i-add-custom-editor-hints-to-netbeans&usg=ALkJrhjd2hgVGOzrphNBTBrSJo0CdFr0zgVim: ั ะพัะพัะธะน ัะฟะพัะพะฑ ะฝะฐัััะพะธัั makeprg = xcodebuild? - command-lineCamelContext.start () does not block - javaStarting a Windows service as a standalone application in DEBUG mode - console-applicationBest XMPP library for Python web application - javascriptPython xmpp jabber client in tornado web application - pythonconnection refused an exception when trying to start the jar via web start - javaAll Articles