<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ESRI API Dojo \ on VS data-dojo-attach-event in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-api-dojo-on-vs-data-dojo-attach-event/m-p/94131#M8578</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alberto,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;There are going to be limited&amp;nbsp;times when you will use&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;data-dojo-attach-event. The are a couple of reason for this:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;You will have to have a static widget template, many times a widgets template is dynamically adjusted.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;You can not pause or remove that dijits event.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Once your template is established it is easier to just edit code based functionality in one place (the js file).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;As people read your code it is harder to figure out where the attached event is coming from as it is in a&amp;nbsp;separate&amp;nbsp;file.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;When it comes down to the two&amp;nbsp;snippets&amp;nbsp;of code the function almost identically so there is little to no difference. It is more of a&amp;nbsp;preference.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2016 11:58:53 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2016-09-29T11:58:53Z</dc:date>
    <item>
      <title>ESRI API Dojo \ on VS data-dojo-attach-event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-api-dojo-on-vs-data-dojo-attach-event/m-p/94130#M8577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am studying the ArcGIS API javascript to create widgets and I don`t understand what is the difference between Dojo \ on in the Widget.js file and data-dojo-attach-event in the template.html file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Dojo \ on is used and when data-dojo-attach-event?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the difference between these two snippets of code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Widget.js file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on(this.alertButton, "click", myFunction ())&lt;BR /&gt; myFunction () {&lt;BR /&gt; topic.publish("alertUser", "I am alerting you.");&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In template.html:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;button &lt;SPAN&gt;data-dojo-attach-point= 'alertButton'&amp;nbsp;&lt;/SPAN&gt;data-dojo-attach-event='click: myFunction '&amp;gt;press me&amp;lt;/button&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 10:11:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-api-dojo-on-vs-data-dojo-attach-event/m-p/94130#M8577</guid>
      <dc:creator>AlbertoLópez</dc:creator>
      <dc:date>2016-09-29T10:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI API Dojo \ on VS data-dojo-attach-event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-api-dojo-on-vs-data-dojo-attach-event/m-p/94131#M8578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alberto,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;There are going to be limited&amp;nbsp;times when you will use&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;data-dojo-attach-event. The are a couple of reason for this:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;You will have to have a static widget template, many times a widgets template is dynamically adjusted.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;You can not pause or remove that dijits event.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Once your template is established it is easier to just edit code based functionality in one place (the js file).&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff;"&gt;As people read your code it is harder to figure out where the attached event is coming from as it is in a&amp;nbsp;separate&amp;nbsp;file.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;When it comes down to the two&amp;nbsp;snippets&amp;nbsp;of code the function almost identically so there is little to no difference. It is more of a&amp;nbsp;preference.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 11:58:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-api-dojo-on-vs-data-dojo-attach-event/m-p/94131#M8578</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-09-29T11:58:53Z</dc:date>
    </item>
  </channel>
</rss>

