<?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: Simple Button available in JSAPI? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737639#M68322</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Rene. That's great. Somehow, I didn't realize that I could use the&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;view.ui.add()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;syntax to integrate a regular HTML dom element into&amp;nbsp;my view. Learning one post at a time here.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Apr 2019 20:37:04 GMT</pubDate>
    <dc:creator>Arne_Gelfert</dc:creator>
    <dc:date>2019-04-22T20:37:04Z</dc:date>
    <item>
      <title>Simple Button available in JSAPI?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737637#M68320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking for the simplest way to add a button&amp;nbsp;to my view UI when developing with the JS API. By simple I mean really just a UI elements that I can hookup to any necessary callback.&amp;nbsp;For example, I might want to include the search widget to search for a record to select/highlight in the map, and only when the extra &lt;STRONG&gt;&lt;EM&gt;simple&lt;/EM&gt; &lt;/STRONG&gt;button is clicked, do I get a popup or a buffer for my feature. I'm surprised there isn't something like a "Simple Button" widget. Or have I missed it? I see an &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-support-actions-ActionButton.html" rel="nofollow noopener noreferrer" target="_blank"&gt;Action Button&lt;/A&gt; for use inside a Popup, which I think will be helpful in another context. But more than I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I'm having to follow the advice &lt;A _jive_internal="true" href="https://community.esri.com/thread/171992" target="_blank"&gt;here &lt;/A&gt;to do:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;div&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;id&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;mapDiv&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;  
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;div&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;id&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;button&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;  
            &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;&lt;/SPAN&gt;button&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;data-dojo-type&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;dijit/form/Button&lt;SPAN class="punctuation token"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="attr-name token"&gt;id&lt;/SPAN&gt;&lt;SPAN class="attr-value token"&gt;&lt;SPAN class="punctuation token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;'&lt;/SPAN&gt;simpBtn&lt;SPAN class="punctuation token"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;My Simple Button&lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;button&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;  
        &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;  
    &lt;SPAN class="token tag"&gt;&lt;SPAN class="token tag"&gt;&lt;SPAN class="punctuation token"&gt;&amp;lt;/&lt;/SPAN&gt;div&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;  &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the result doesn't blend right in with the style of my other UI elements. This approach &lt;A _jive_internal="true" href="https://community.esri.com/thread/79694" target="_blank"&gt;here &lt;/A&gt;didn't seem to work for me. My button just gets covered up by map despite the z-index of 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been taking my time before getting into the custom widgets using Typescript. Has the time come to take that approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:25:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737637#M68320</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T07:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Button available in JSAPI?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737638#M68321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not exactly sure I follow the use case, but you can add any DOM element to a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#add" rel="nofollow noopener noreferrer" target="_blank"&gt;View UI&lt;/A&gt; in 4x.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you could do something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; btn &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; document&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;createElement&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'button'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
btn&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;innerText &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Open Popup for Search'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ui&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;add&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;btn&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'top-right'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
btn&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;addEventListener&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'click'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;searchResult&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;popup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;open&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      features&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;searchResult&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
      location&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; searchResult&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample that kind of does what you described.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://jsbin.com/yiwovu/1/edit?html,output" title="https://jsbin.com/yiwovu/1/edit?html,output" rel="nofollow noopener noreferrer" target="_blank"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would need to style the button as desired, is all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:25:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737638#M68321</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-12T07:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Button available in JSAPI?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737639#M68322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Rene. That's great. Somehow, I didn't realize that I could use the&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;view.ui.add()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;syntax to integrate a regular HTML dom element into&amp;nbsp;my view. Learning one post at a time here.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2019 20:37:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/simple-button-available-in-jsapi/m-p/737639#M68322</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2019-04-22T20:37:04Z</dc:date>
    </item>
  </channel>
</rss>

