<?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 TOC To Float in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-to-float/m-p/653229#M60865</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi...I am new to GIS, I want my TOC panel to be floating. The floating Toc needs to be evoked from a button click. I tried to to it through javascript, but no success.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jul 2013 08:26:40 GMT</pubDate>
    <dc:creator>RohitTiwari</dc:creator>
    <dc:date>2013-07-18T08:26:40Z</dc:date>
    <item>
      <title>TOC To Float</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-to-float/m-p/653229#M60865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi...I am new to GIS, I want my TOC panel to be floating. The floating Toc needs to be evoked from a button click. I tried to to it through javascript, but no success.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jul 2013 08:26:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-to-float/m-p/653229#M60865</guid>
      <dc:creator>RohitTiwari</dc:creator>
      <dc:date>2013-07-18T08:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: TOC To Float</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-to-float/m-p/653230#M60866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should be able to put pretty much anything you want in a floating pane.&amp;nbsp; I'm managing mine with a combination of HTML, CSS and JS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you using floating panes, you also need to create something called a dock. I too wanted my pane to be opened with a button click.&amp;nbsp; You don't want the floating pane to be open until you click the button, so its default style will have a hidden visibility.&amp;nbsp; There is some other styling you'll need to consider too.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 - add a button&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 &amp;lt;button id="btnFloat" dojotype="dijit.form.Button" onClick="openFloater();"&amp;gt;Open Floating Pane
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div dojoType="dojox.layout.Dock" id="dock"&amp;nbsp; &amp;gt;&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;lt;/div&amp;gt; &amp;lt;/button&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 - define the floating pane&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You will also need to define your floating pane.&amp;nbsp; I put mine within my mapDiv.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;div id="mapDiv" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'"&amp;gt;
&amp;nbsp; 
&amp;nbsp;&amp;nbsp; &amp;lt;div id="floater" dojoType="dojox.layout.FloatingPane" title='My Floating Pane' dockTo="dock" style="visibility:hidden;" closable="false" resizable="true" dockable="true"&amp;gt;&amp;nbsp; 
&amp;lt;div id="tocDiv"&amp;gt;&amp;lt;/div&amp;gt; 
 &amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#3 - write some code to open the floating pane.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Next you'll need some code to open the floating pane.&amp;nbsp; All you're doing is to change the visibility of the floating pane for its initial visibility:hidden.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function openFloater() {

&amp;nbsp; var fp = dijit.byId('floater');
&amp;nbsp;&amp;nbsp; if ((fp.style = "visibility: hidden;") || (fp.style = "VISIBILITY:hidden;")) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fp.style.visibility="visible";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fp.show();
&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#4 - add the required dojo and CSS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You will need to remember to add the dojo.require statement for the floatingPane.&amp;nbsp; I'm still using the legacy style, so in my code this looks like this.&amp;nbsp; You'll need to remember to add the resize handlers or your floating pane won't be resizable. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("dojox.layout.FloatingPane");
&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.require("dojox.layout.ResizeHandle");
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll need to add the css defintion for this as well:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dojox/layout/resources/FloatingPane.css"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;link rel="stylesheet" type="text/css" href="https://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dojox/layout/resources/ResizeHandle.css"&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#5 - add the necessary styling for your floater and docks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Last, you'll need to have some styles set up.&amp;nbsp; If you don't , the dock will appear as an icon, but since you want to use the button as the image, you don't need the dock to be visible too.&amp;nbsp; You'll need to adjust for the size of your TOC and where you want it to appear in your map.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 #floater {
&amp;nbsp;&amp;nbsp;&amp;nbsp; position: absolute;
&amp;nbsp;&amp;nbsp; top: 100px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; left: 175px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 260px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 140px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 99;
&amp;nbsp; }
#dock {
&amp;nbsp;&amp;nbsp;&amp;nbsp; position:absolute;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border-style:hidden;
&amp;nbsp;&amp;nbsp;&amp;nbsp; z-index: 99;
&amp;nbsp;&amp;nbsp;&amp;nbsp; top: 28px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; right: 330px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 0px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 0px;
&amp;nbsp;&amp;nbsp;&amp;nbsp; font-family: Arial, Helvetica, sans-serif;
&amp;nbsp;&amp;nbsp;&amp;nbsp; font-size: 12pt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; visibility:hidden;
&amp;nbsp;&amp;nbsp;&amp;nbsp; display:none;
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:41:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-to-float/m-p/653230#M60866</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2021-12-12T03:41:16Z</dc:date>
    </item>
  </channel>
</rss>

