<?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: Cannot read property 'on' of undefined in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-read-property-on-of-undefined/m-p/566599#M52886</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ella,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That error does not mean you are having an issue with dojo/on it means that you are not finding the target object that you want to person the on on.&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;registry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"symbolList"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is what is returning&amp;nbsp;undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Dec 2017 02:01:46 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-12-12T02:01:46Z</dc:date>
    <item>
      <title>Cannot read property 'on' of undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-read-property-on-of-undefined/m-p/566598#M52885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I basically copied one of ESRI's samples with the intention of modifying it. However, it doesn't seem to recognize the "on" in the "require" statement. I'm not sure what I'm doing wrong here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Console error:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;TypeError: Cannot read property 'on' of undefined&lt;BR /&gt; at l (init.js:122)&lt;BR /&gt; at symbology-picker.js:48&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbology-picker.js:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt; "dojo/parser",&lt;BR /&gt; "dojo/ready",&lt;BR /&gt; "dojo/dom",&lt;BR /&gt; "dojo/dom-construct",&lt;BR /&gt; "dojo/_base/array",&lt;BR /&gt; "dojo/_base/json",&lt;BR /&gt; "dijit/registry",&lt;BR /&gt; &lt;STRONG&gt;"dojo/on",&lt;/STRONG&gt;&lt;BR /&gt; "dojo/_base/connect",&lt;BR /&gt; "esri/dijit/editing/TemplatePicker",&lt;BR /&gt; "esri/arcgis/Portal",&lt;BR /&gt; "esri/domUtils",&lt;BR /&gt; "esri/config",&lt;BR /&gt; "esri/request",&lt;BR /&gt; "esri/symbols/jsonUtils",&lt;BR /&gt; "esri/symbols/Symbol",&lt;BR /&gt; "esri/lang",&lt;BR /&gt; "dojo/store/Memory",&lt;BR /&gt; "dijit/form/ComboBox",&lt;BR /&gt; "dijit/layout/BorderContainer",&lt;BR /&gt; "dijit/layout/ContentPane"&lt;BR /&gt;], function (&lt;BR /&gt; parser,&lt;BR /&gt; ready,&lt;BR /&gt; dom,&lt;BR /&gt; domConstruct,&lt;BR /&gt; array,&lt;BR /&gt; dojoJson,&lt;BR /&gt; registry,&lt;BR /&gt; &lt;STRONG&gt;on,&lt;/STRONG&gt;&lt;BR /&gt; connect,&lt;BR /&gt; TemplatePicker,&lt;BR /&gt; arcgisPortal,&lt;BR /&gt; domUtils,&lt;BR /&gt; config,&lt;BR /&gt; esriRequest,&lt;BR /&gt; jsonUtils,&lt;BR /&gt; Symbol,&lt;BR /&gt; esriLang,&lt;BR /&gt; Memory&lt;BR /&gt;) {&lt;BR /&gt; var templatePicker, store;&lt;BR /&gt; ready(function () {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;parser.parse();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var portalUrl = document.location.protocol + "//www.arcgis.com";&lt;BR /&gt; &lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;on(registry.byId("symbolList"), "change", updateSymbolDisplay);&lt;SPAN style="color: #339966;"&gt; //&amp;lt;-- erroring here&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...(more code)&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in my scripts section:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F3.22%2F" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/3.22/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;lt;script src="~/Scripts/symbology-picker.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=portal_symbols" title="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=portal_symbols"&gt;ArcGIS API for JavaScript Sandbox&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only idea I have right now is maybe some sort of conflict with jQuery, but we are using it successfully in other parts of our project which include a map page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I were to call "on" using its class, how would I do that? "dojo.on()" doesn't seem to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2017 01:23:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-read-property-on-of-undefined/m-p/566598#M52885</guid>
      <dc:creator>EllaHaines</dc:creator>
      <dc:date>2017-12-12T01:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot read property 'on' of undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-read-property-on-of-undefined/m-p/566599#M52886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ella,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That error does not mean you are having an issue with dojo/on it means that you are not finding the target object that you want to person the on on.&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;registry&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;byId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"symbolList"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is what is returning&amp;nbsp;undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Dec 2017 02:01:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-read-property-on-of-undefined/m-p/566599#M52886</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-12-12T02:01:46Z</dc:date>
    </item>
  </channel>
</rss>

