<?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 changing the structure of the Legend dijit in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374651#M34760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to modify the legend widget so that the swatch and label are shown on one line (i.e. adjacent to eachother). The default dijit places the swatch below the label. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this example, it is shown as I would like it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_legend.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_legend.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem I am having is that the design is not controlled by CSS/styling, but has a completely different HTML structure. In checking the code of the sample above, I can see that the HTML structure is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;SWATCH&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;LABEL&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;however, in the default dijit, it is drawn as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;LABEL&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;SWATCH&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange, since as far as I can tell, the default and demo both use the same dijit! Does anyone know how I can setup the legend to match the demo?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jan 2011 05:40:37 GMT</pubDate>
    <dc:creator>RichardKaufholz</dc:creator>
    <dc:date>2011-01-13T05:40:37Z</dc:date>
    <item>
      <title>changing the structure of the Legend dijit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374651#M34760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to modify the legend widget so that the swatch and label are shown on one line (i.e. adjacent to eachother). The default dijit places the swatch below the label. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this example, it is shown as I would like it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_legend.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_legend.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem I am having is that the design is not controlled by CSS/styling, but has a completely different HTML structure. In checking the code of the sample above, I can see that the HTML structure is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;SWATCH&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;table&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;LABEL&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/table&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;however, in the default dijit, it is drawn as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;LABEL&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;td&amp;gt;SWATCH&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange, since as far as I can tell, the default and demo both use the same dijit! Does anyone know how I can setup the legend to match the demo?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 05:40:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374651#M34760</guid>
      <dc:creator>RichardKaufholz</dc:creator>
      <dc:date>2011-01-13T05:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: changing the structure of the Legend dijit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374652#M34761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i have used the legend, inside a panel like that example. you shouldnt need to modify the html inside the dijit.... if the legend div is wide enough, the icon/label will be side by side. if the div is not wide enough, it will auto wrap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 21:00:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374652#M34761</guid>
      <dc:creator>timgogl</dc:creator>
      <dc:date>2011-01-13T21:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: changing the structure of the Legend dijit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374653#M34762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi lowgas,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for getting back to me. Unfortunately, its not the width of the div that is causing the legend to&amp;nbsp; wrap - logically, such wrapping would be controlled by the CSS, but as I showed in the code samples below, the actual HTML structure seems to come out different in the sample and the demo. The structure that is created in using the sample wont allow the label to be adjacent because it is placed in the next table row element (TR).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can also see from the attached jpg that setting the width much larger than the legend entries doesnt solve the problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jan 2011 03:58:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374653#M34762</guid>
      <dc:creator>RichardKaufholz</dc:creator>
      <dc:date>2011-01-14T03:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: changing the structure of the Legend dijit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374654#M34763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hrm... interesting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am kinda stuck for an idea... i just used pretty much the code directly from the sample, and mine come out side by side.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 23:07:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374654#M34763</guid>
      <dc:creator>timgogl</dc:creator>
      <dc:date>2011-01-18T23:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: changing the structure of the Legend dijit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374655#M34764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, so I did some more in-depth comparison of the code - and think I have the answer. Unfortunately, the dijit doesnt put the patch adjacent to the label at all - it puts the &lt;/SPAN&gt;&lt;STRONG&gt;sub-category label&lt;/STRONG&gt;&lt;SPAN&gt; there &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the esri demo, the first set of icons for "Points of Interest" are in fact sub categories of that layer itself, styled using unique symbols - the actual layer label is above the patches. In scrolling down to the Fire Perimeter layer you will see the standard layer-label combination without any classification.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I guess its not possible unless you write the code yourself! I am also going to try see if I can work around it by "cheating" the label and sub label text in the source MXD, but not holding out too much hope.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks anyway.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 05:16:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374655#M34764</guid>
      <dc:creator>RichardKaufholz</dc:creator>
      <dc:date>2011-01-19T05:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: changing the structure of the Legend dijit</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374656#M34765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;maybe 'cheat' it with in-line styles?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jan 2011 15:29:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-the-structure-of-the-legend-dijit/m-p/374656#M34765</guid>
      <dc:creator>timgogl</dc:creator>
      <dc:date>2011-01-19T15:29:08Z</dc:date>
    </item>
  </channel>
</rss>

