<?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: context menus limitations? in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820516#M7320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I access the labels assigned for the context menu of a graphic?&lt;/P&gt;&lt;P&gt;I tried ctxMenuForGraphics.MenuItem.label[0] but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that when you assigned a menu to a graphic A and then a bigger graphic B with its own menu covers graphic A, even if you remove the graphic B later, the menu A will be changed to the one that graphic B had. Strange and I am trying to keep the menu for graphics A unchanged.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Nov 2015 22:57:17 GMT</pubDate>
    <dc:creator>LefterisKoumis</dc:creator>
    <dc:date>2015-11-18T22:57:17Z</dc:date>
    <item>
      <title>context menus limitations?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820514#M7318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed that inside the click function of a context menu I don't have access to the map object or call a new function outside the context menu.&lt;/P&gt;&lt;P&gt;Are these limitations for the context menus?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the script below, I get these errors....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cannot read property 'addLayer' of undefined&lt;/P&gt;&lt;P&gt;this.myfunction is not a function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;ctxMenuForGraphics = new Menu({});&lt;/P&gt;&lt;P&gt;&amp;nbsp; ctxMenuForGraphics.addChild(new MenuItem(&lt;/P&gt;&lt;P&gt;&amp;nbsp; { &lt;/P&gt;&lt;P&gt;&amp;nbsp; label: "something", &lt;/P&gt;&lt;P&gt;&amp;nbsp; onClick: function ()&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; this.map.addLayer(xxx);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; this.myfunction(); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &lt;/P&gt;&lt;P&gt;&amp;nbsp; })); &lt;/P&gt;&lt;P&gt;&amp;nbsp; ctxMenuForGraphics.startup();&lt;/P&gt;&lt;P&gt;--------&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;myfunction: function(){&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;},&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2015 19:37:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820514#M7318</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2015-11-18T19:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: context menus limitations?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820515#M7319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; This works fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ctxMenuForGraphics = new Menu({});
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctxMenuForGraphics.addChild(new MenuItem({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label: "info",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onClick: lang.hitch(this, function (){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.info(this.map);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; })
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:43:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820515#M7319</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: context menus limitations?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820516#M7320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I access the labels assigned for the context menu of a graphic?&lt;/P&gt;&lt;P&gt;I tried ctxMenuForGraphics.MenuItem.label[0] but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I notice that when you assigned a menu to a graphic A and then a bigger graphic B with its own menu covers graphic A, even if you remove the graphic B later, the menu A will be changed to the one that graphic B had. Strange and I am trying to keep the menu for graphics A unchanged.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2015 22:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820516#M7320</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2015-11-18T22:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: context menus limitations?</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820517#M7321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For the first part of the question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;ctxMenuForGraphics.addChild(new MenuItem({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; label: "info",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onClick: lang.hitch(this, function (evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.info(evt.target.innerHTML);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; })
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the second part, I don't have any experience there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:43:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/context-menus-limitations/m-p/820517#M7321</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T09:43:50Z</dc:date>
    </item>
  </channel>
</rss>

